Boost calling method from outside of class -


let's see how simple of question can ask. have:

void tcpclient::test(const boost::system::error_code& errorcode) {     // can here } 

and call class. have global boost::thread_group creates thread

clientthreadgroup->create_thread(boost::bind(&tcpclient::test,client, /* need */)); 

but uncertain on how call test, if correct way.

as explanation overall project, creating tcp connection between client , server , have method "send" (in class) called when data needs sent. current goal able call test (which has async_send in it) , send information through socket set when called. however, open other ideas on how implement , work on creating consumer/producer model if proves difficult.

i can use either project, later have implement listen able receive control packets server later, if there advice on method use, appreciate it.

boost::system::error_code err; clientthreadgroup->create_thread(boost::bind(&tcpclient::test,client, err)); 

this works me. don't know if have error if goes wrong, if wants correct me there, appreciate (if experience sake).


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -