CMessengerServerSocket

Back to Classes Page

Parent Class: CSocket

Only 1 object of this class is created. It's the main Server Socket object of the application. It keeps on listening on a specified port, and accepts connections from clients.

Field Summary

Access Data Type Name
public CMessengerServerDoc * m_pParent

Constructor Summary

CMessengerServerSocket()
CMessengerServerSocket(CMessengerServerDoc *m_pParent)

Destructor Summary

~CMessengerServerSocket()

Method Summary

virtual void OnAccept(int nErrorCode)
virtual void OnClose(int nErrorCode)

Field Detail

m_pParent
Address of the Document object. Server socket object is inside the document object, and it needs this pointer to invoke data processing methods from the same.

Constructor Detail

CMessengerServerSocket()
Default constructor. Never use this constructor.

CMessengerServerSocket(CMessengerServerDoc *pParent)
Always use this constructor. It sets the Document pointer inside the socket, enabling it to call the Document object methods.

Destructor Detail

~CMessengerServerSocket()
Default destructor, nothing additional written.

Method Detail

OnAccept(int nErrorCode)
Notifies the Document object about data being received on the socket.


OnClose(int nErrorCode)
Closes the Server Socket.


Back to Classes Page