i am writting a console client to control AMSN remotely, but the send funcion won't send any data.
This is the function I use to send data.
- Code: Select all
put(string msg) {
int datasend;
int len=msg.length();
const char *data=msg.c_str();
if(datasend=send(sock,data,len,0)==-1) {
perror("send");
exit(1);
}
cout << "Sent " << datasend << "/" << len << " bytes of data..." << endl;
}
The socket is right, I see that I connected in AMSN. But the output is:
The Sent 0/21 bytes of data...
I am sending: "roadkillbunny@msn.com"
When I quit my program with crtl-C (it just hands there after it says it sent it), AMSN recieves the string.
Cheers
--RoadkillBunny
PS: Not sure if this is a c++ or tcl/tk related problem.
