Winsock control help? (writting a socket accept server) 
Author Message
 Winsock control help? (writting a socket accept server)


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

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.

Mon, 27 May 2002 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Winsock control not accepting multiple connections with Array

2. Winsock control not accepting multiple connections with Array

3. Winsock control not accepting multiple connections

4. async server example

5. How to accept multiple Socket connections?

6. Visual Basic 4 Socket communication (WinSock) Need Help!

7. Help: Winsock-redirect stdin/stdout to socket handle

8. Multiple Winsock-Connections to a server AND Winsock-Connection to a server minimized in systray

9. Using WINSOCK control to access server through PROXY SERVER

10. Getting information about files on servers via Socket-Control


12. Client/Server socket help


Powered by phpBB® Forum Software