Debug mode & Run mode

suwuming
12-18-2001, 09:39 PM
Hi all,
I have created a socket as server, and another as client, then maked the server listen, and didn't use accept method.(only listen). The problem was :
1. when I used client socket in debug mode(in VB IDE step by step) to conncet server, the state of client socket would be 0-->6-->8(Closed-->Connecting-->Closed), that was a correct sequence, because the server did never accept its request.
2. But, when I started client in run mode(press F5), then connect event would occur(means connection was successful), and the state would be 0-->7-->8(Closed-->Connected-->Closed).

I think if the server dont accpet client's request, the connection wiil never be successful.
Anybody can tell me why? Thanks (I used Winscok 6.0 SP5)

divil
12-19-2001, 05:54 AM
Of course the connection won't be successful if the server doesn't accept the request.

Debugging winsock code step by step is not a good idea, because sometimes events will happen too fast for you stepping through the code and therefore they won't fire.

ChiefRedBull
12-19-2001, 03:25 PM
Not accepting a winsock is like not picking up a telephone if its ringing, then expecting to be able to talk to the person on the other end. It just ain't gonna happen.

Accept the incoming call using:
<pre><font color=blue>Winsock1.Close
Winsock1.Accept requestID

</pre></font color=blue>Bo! Selecta!!

suwuming
12-19-2001, 07:46 PM
Thank you, but the problem was:
when I run the program, the socket state would be 0--&gt;7--&gt;8(Closed--&gt;Connected--&gt;Closed). "connected" !!!, even server did never accept it!

ChiefRedBull
12-21-2001, 07:09 AM
Post the code you're using to connect, and accept the connection. The problem is probly there.... otherwise look at your firewall configuration.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum