Board index » Visual Studio » WinSock nightmare
|
Kobe
|
WinSock nightmare
Visual Studio262
hi i have written a server and client application which gathers stats data using another app (Statapp),Statapps is also written in VB and complied to exe. Statapp accept shell parameters and send messages to my server about the its progress (wether sampling has started, completed or error has occured). All the messages are passed successfully in started and completed case but if user close the the gui of Atatapp no message is sent to server. i have writen the following code in Query_Unload. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) 'checking the state of TCPSocket If TCPSocket.State = 7 Then MsgBox " Sampling process has been intrupted ." _ & vbCrLf & " Sending status to server.", vbCritical, "Process Intrupted" message = "ERROR" + tokenSeperator + profiles.ProfileNumber + tokenSeperator + profiles.SampleNumber + tokenSeperator + profiles.SID + endOfFile sendToServer (message) Timer1.Enabled = False Timer2.Enabled = False Timer3.Enabled = False TCPSocket.Close Else MsgBox "Not Connected ." End If End Sub TCPSocket check returns true (i.e that Statapp is still connected to my server) can any one help in this prob TIA SC - |
