|
-
February 5th, 1999, 06:03 AM
#1
Winsock .Connect & .Close Problem
While connecting and closing is a no problem, but once i .close and want to reconnect ( .connect ) again, somehow the other side wouldnt want to respond to my .connect
Do i need like to initialize something or close some other function before reconnecting ( .connect ) again?
Client connects to server. No problem, client .close from server, no problem also. But when i want the client to .connect again to the server, no response.
Please help...
-
February 8th, 1999, 10:43 PM
#2
Re: Winsock .Connect & .Close Problem
This is the way that I solved this problem..
Whenever your application have to provide re-establish connection, you have to
1. create a form with winsock control (example name : frmsocket, and winsock)
2. Declare global variable as control (example : mysocket)
3. when you want to open connection
3.1 set mysocket = new frmsocket
3.2 openconnection by mysocket.winsock.open
4. when you want to close connection, you have also unload the form.
4.1 mysocket.winsock.close
4.2 mysocket.unload
4.3 set mysocket = nothings (release the resource for this objects)
because of everytime when the winsock has been opened, the system will generate the unique/unreuseable socket handlenumber automatically, so you have to always create a new winsock at runtime.
sorry for my weak english.
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
|