I am writing a client for our local Postocde server. The Client has to send and receive address information to and from the server. The server runs under UDP. I can successfully send strings to the server but if for whatever reason the server does not reply my program will have indefinately. I have tried the folloing:
receiveBytes = PCClient.Receive(RemoteIpEndPoint)
Catch l As Exception
MsgBox("Error Connecting to Postcode Server", MsgBoxStyle.Critical, "Postcode server error")
but the receivebytes line does not appear to generate any kind of exception....it just hangs on the line.
When I step through the code, because I step through slower than if it was executing the server has usually replied by the time I get to this line.
Does anyone have any ideas/solutions to stop the program hanging when it doesn't receive data??
Thanks in Advance