|
-
September 3rd, 2001, 03:33 PM
#1
Failed to close socket connection
hi,
i am using a Winsock control in my application.
i wrote some lines of code in the Close event of the control but when i activate the Close function it doesn't close the connection and dont get into the Close event.
is that a common problem? any idea how to solve it?
thank,
ohad.
-
September 3rd, 2001, 07:18 PM
#2
Re: Failed to close socket connection
somehow even we close it but winsock has an option called LINGER which determine the behaviour of the shutdown.... In VC++, CSocket can't control it, only CAsyncSocket can... I think winsock control should be similar to CSocket... but winsock control expose a property - SocketHandle which can be used with API.
I used to use the following code to make sure it really close..
Do While winsock1.State <> sckClosed
HTTPWS.Close
DoEvents
Loop
HTH
cksiow
http://vblib.virtualave.net - share our codes
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
|