Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do U test the State of a UDP connection?

Status
Not open for further replies.

TrueCode

MIS
Joined
Sep 30, 2003
Messages
71
Location
LC
I don't want the client to open if the server is not available. I tried sending a message to the server and trap the send error to select my action. However, I find that the programme goes past the line from which the message is sent before the error trapping routine acts.

So I decided to create an iteration immediately after the send message statement ( i have a separate routine for sending messages which is called in the init()). The iteration should break if the error condition is met, i.e if the error() routine sets a variable to a particular value.

But to my dismay that iteration never breaks, it goes on forever.


I am sure someone had to be faced with this problem, some point in time.

------------------------------------->

"I have sought your assistance on this matter because I have exhausted all the help that I can find. You are free to direct me to other source of help"
 
TrueCode,

The nature of UDP is that it is "connectionless". You simply bind your local port to a server's port and fire away. There is no way to test if the server is listening.

You can read about TCP vs. UDP basics at:


It sounds like you want to create a TCP connection. You truly make a connection using this protocol and you can test to check the state of the connection at any time.

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top