How do I check if a port is open. How do I close a port.
Whenever I get a winsock error I have to restart my computer before I can connect again.
Printable View
How do I check if a port is open. How do I close a port.
Whenever I get a winsock error I have to restart my computer before I can connect again.
hum...for the winsock control add for close property winsock.close and add that for the error too...make sure it closes the port when it exits...(both for server and client)
I am already checking if the winsock is closed. I need to know how to close ports that the modem is using.....
Private Sub wskClient_Close()
wskClient.Close
End Sub
Private Sub wskClient_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
wskClient.Close
End Sub
or anywhere in your program...
form.wskClient.close
or if you want to close a port that is currently open...
if wskClient.state <> sckClosed then wskClient.close
when you get that error just use your immediate window in debug mode to close the port off.
wskClient.LocalPort = 6969
wskClient.Close