A
Angus
Hello
I have some networking classes. I have a base class - CBasicSocket,
then a server socket which is CServerSocket : public CBasicSocket and
a client socket which is CClientSocket : public CBasicSocket.
The client class gets notified via a virtual function when the socket
is dosconnected. The server class gets notified if the server socket
is disconnected - ie the server shuts down.
My server class holds a collection of clients. When the server class
gets a connection from a new client, this collection gets
incremented. But I need to decrement the collection when a client
disconnects. But my CServerSocket class doesn't get notified about
this event. CClientSocket does. So does my CServerSocket class need
to contain a CClientSocket class? How do I set this up so that my
CServerSocket class gets the notification that a client has
disconnected?
I have some networking classes. I have a base class - CBasicSocket,
then a server socket which is CServerSocket : public CBasicSocket and
a client socket which is CClientSocket : public CBasicSocket.
The client class gets notified via a virtual function when the socket
is dosconnected. The server class gets notified if the server socket
is disconnected - ie the server shuts down.
My server class holds a collection of clients. When the server class
gets a connection from a new client, this collection gets
incremented. But I need to decrement the collection when a client
disconnects. But my CServerSocket class doesn't get notified about
this event. CClientSocket does. So does my CServerSocket class need
to contain a CClientSocket class? How do I set this up so that my
CServerSocket class gets the notification that a client has
disconnected?