Now I will be a server, the socket initialization, create a socket, binding, listening, waiting to receive on the App class, open a new thread to do this,
But I always think this thing is not do, please expert guidance,
CodePudding user response:
Socket development there are five kinds of mode, select use is more, can realize single thread client involvement, you try,CodePudding user response:
Can use c + + Builder first make network part a com for vcCodePudding user response:
I mean, write their own the network initialization, binding, listen to wait for, such as where to put in the MFC,As I began to say, I opened a thread in the App, put in all these, don't know how to make standard network programming,
Do com younger brother this newbie level, not the

CodePudding user response:
The class mysocket{
Public:
Virtual void OnAccept ();
Virtual void OnClose ();
Virtual void OnConnect ();
Virtual void OnReceive ();
Virtual void OnSend ();
Int senddata publishes the event ();
}
In OnInitDialog:
New mysocket
In OnDestroy
The delete mysocket