Re: hello, where can i get a great example which demostrates how to wirte a high preformance, scalable UDP Server?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Google Mike (googlemike_at_hotpop.com)
Date: 12/02/04


Date: 2 Dec 2004 12:02:59 -0800


"wenming hu" <wenming_hu2002@hotmail.com> wrote in message news:<uIQkUfE2EHA.4072@TK2MSFTNGP10.phx.gbl>...
> thank u very much!

I don't recommend it. Unlike TCP, UDP is designed to break up its
packets and it takes a fairly sophisticated server app to put the
packets in the right order and to ask for missing packets it did not
receive. You can build it with some fairly good success with VB6
Winsock control, or perhaps something in Java, PHP, or .NET, but once
the packet size hits a certain limit, the packets start breaking apart
and chaos starts to happen. Also, as your corporate net teams tweak
the routers your app could suddenly stop working, as my UDP service
stopped working about 10 years ago, forcing me to switch to smaller
UDP messages and then ultimately forcing me to switch the app to
complete TCP.

A better design is to make a TCP server that acts like passive FTP --
one authentication port and a series of callback ports in a designated
range like 21000-21100. The client calls the server on port, say,
19000, says hello and authenticates properly, and then the server
says, "call me back on your designated port of 21001". The client then
calls back on that port and the server interacts with it. So what good
is UDP at that point? UDP is great, at that point, to act as a
"heartbeat", constantly checking the server with very short messages
to determine if it can respond (more sophisticated than just a simple
ping) to requests or is overloaded or has a hung TCP connection, which
then tells the client to drop the connection and try to re-establish
it, and, failing that, tell the client to post an error message.

Hope this helps.



Relevant Pages

  • "Resource temporarily unavailable": a firewall issue?
    ... I have some simple client and server programs which use UDP sockets. ... 26 packets to unknown port received. ...
    (comp.os.linux.setup)
  • "Resource temporarily unavailable": a firewall issue?
    ... I have some simple client and server programs which use UDP sockets. ... 26 packets to unknown port received. ...
    (comp.os.linux.development.apps)
  • Re: How to know server is alive?
    ... packets,so how can I know that whether the UDP server to which I am ... Or someone sent you a UDP datagam with the IP source address spoofed ... Your gateway router prevents packets claiming to be from your ... Routers on the internet at large ...
    (comp.unix.programmer)
  • Re: Subnet and address translation
    ... Now these machines are sending some packets to a outside UDP ... > Can anybody tell me, while receiving packets from server, how the ... > corporate connection will be deciding that which packet belongs to ...
    (comp.os.linux.networking)
  • Re: Subnet and address translation
    ... Now these machines are sending some packets to a outside UDP ... > Can anybody tell me, while receiving packets from server, how the ... > corporate connection will be deciding that which packet belongs to ...
    (comp.unix.programmer)