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