frozenpost
Jan 21st, 2007, 05:36 PM
I am trying to create a program what checks that my pop3 server is still running, using Winsocket.
Has anyone got any better ways of doing it or sugestions.
the182guy
Jan 21st, 2007, 06:29 PM
thats easy, use the winsock control, project>compnants>microsoft winsock control. add a button and winsock to the form and put:
Private Sub Command1_Click()
Winsock1.Close
Winsock1.Connect "pop.tiscali.co.uk", 110
End Sub
Private Sub Winsock1_Close()
Winsock1.Close
MsgBox "Server terminated the connection"
End Sub
Private Sub Winsock1_Connect()
Winsock1.Close
MsgBox "The server is alive"
End Sub
Private Sub Winsock1_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)
Winsock1.Close
MsgBox "Server is down"
End Sub
Click the button to check if the server is alive or not