Quote Originally Posted by steebu View Post
... The "entry" point for the SDK is the execute() function, ...
I don't understand anything about this statement. What do you mean by "entry point"? What do you mean by SDK ("Software development kit")? What do you mean by the "execute()" function? Is it the thread function we've been discussing? If not, where is it and how is it called?


Code:
mSocket s;
s.Create();
if( s.Connect( ip, port ) == 0 ) {
  // error check
}
s.Send();  // so will the code wait to run this until it runs OnConnect(), which, seemingly never gets called?
This code can't work, for the reason that the mSocket variable is created on the stack and therefore is destroyed immediately, right after the call to Send().

It might be helpful if you study this sample: "CHATTER Sample: Demonstrates a Windows Sockets Client Application" at http://msdn.microsoft.com/library/en...fc_chatter.asp

'CHATTER' is a Windows Sockets Client sample application. It is a single document interface (SDI) application with a splitter window that lets the user send messages to a discussion server ('CHATSRVR', next below), which in turn sends them to multiple other 'CHATTER' users simultaneously.

Other samples of socket programming are shown in this FAQ: Where can I find examples of socket programs? at http://www.codeguru.com/forum/showthread.php?t=326666