I want to connect to the smtp through the lan at the office, it works well the first time but.......
Next tries are always returning 10048 error: "Address already in use"
Any idea to get rid of that ?&%&@# sh****
Printable View
I want to connect to the smtp through the lan at the office, it works well the first time but.......
Next tries are always returning 10048 error: "Address already in use"
Any idea to get rid of that ?&%&@# sh****
What winsock is basicly saying is it's aleady connected to somthing and your address is in use. What you need to do is on your disconnect button or whatever, is close the connection by using winsock1.close
Ok?
here is the code that i use:
Winsock1.Close
Do While Winsock1.State <> sckClosed
DoEvents
STATUS.Text = "disconnecting from " & SMTP_HOST & ". Please wait."
Loop
but it does'nt work if i try after it
That is because there is a port open and it's in use. Try changing the port you are connecting to.
My conclusion is that the port is opened but why on the first time it works but not on the next ?
this is because its not closing the port properly.