
Winsock control help? (writting a socket accept server)
Hi,
I am having problems writting a server program that listens on sockets and
accepts any connections. Each connection is in a new thread using the
CreateObject method to create a new class in a new thread.
It is supposed to work as follows:
* Main class listens on a specified port
* When ConnectionRequest event is fired a new class is created in a different
thread. This class has its own winsock control that is told to Accept the
RequestID as provided by previous ConnectionRequest event.
* The client then gets the Connected event
The client should now be connected successfully to the new class and should be
able to send it data.
What happens is that as soon as the client receives the Connected event it
then receives the Close event.
The status of the winsock control on the new server class at this point is
Connected.
Does anyone have any ideas why the client has been disconnected?
If I run the server program from inside VB so that it is no longer
multithreaded then the client doesn't receive the Close event and can then
happily send data as required.
Any help on this would be appreciated.
Thanks
Ivan