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

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -