|
-
Mar 4th, 2006, 02:22 PM
#1
Thread Starter
Junior Member
When Disconnect, Listen after
What I need is when I disconnect on client it will disconnect on client and server then right after for it to listen on server..know what I mean ?
-
Mar 5th, 2006, 05:27 AM
#2
Re: When Disconnect, Listen after
yea i know what you mean, heres the server Winsock_Close event:
VB Code:
'Basically this event fires when the client disconnects
Private Sub Winsock1_Close()
Winsock1.Close 'Return to closed state
Winsock1.Listen 'Listen for another connection
End Sub
I would put the code in the Winsock_Error event also, so if the socket errors for any reason, it will close and listen for a new connection.
in your client Winsock_Close and Error events you should have something like this...
VB Code:
Winsock.Close
Label1.Caption = "Disconnected"
Last edited by the182guy; Mar 5th, 2006 at 05:30 AM.
Chris
-
Mar 5th, 2006, 08:02 AM
#3
Thread Starter
Junior Member
Re: When Disconnect, Listen after
ohya thats I wasn't thinkin of Winsock_Close sub XD thanks very much
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|