I have a client-server application, where the server sends UDP datagrams to the 
client, and the client measures the speed of the channel. These datagrams are 
sent using the following code:

 case userid of
      1: begin us:=mainform.udpsock1;us.LocalPort:='4001';end;
      2: begin us:=mainform.udpsock2;us.LocalPort:='4002';end;
      3: begin us:=mainform.udpsock3;us.LocalPort:='4003';end;
      4: begin us:=mainform.udpsock4;us.LocalPort:='4004';end;
      5: begin us:=mainform.udpsock5;us.LocalPort:='4005';end;
      6: begin us:=mainform.udpsock6;us.LocalPort:='4006';end;
      7: begin us:=mainform.udpsock7;us.LocalPort:='4007';end;
      8: begin us:=mainform.udpsock8;us.LocalPort:='4008';end;
      9: begin us:=mainform.udpsock9;us.LocalPort:='4009';end;
      10: begin us:=mainform.udpsock10;us.LocalPort:='4010';end;

My problem is: I want that the server only uses one port for sending these 
datagrams (to save resources), that's what I tried to set in LocalPort 
property. But there is no use of this, the server gives a new source port 
randomly for every datagram between 4000 and 5000. The destination port on the 
client side is constantly 5000, that is what I set.

Is there any way to limit the server side to use just one port for sending, 
then reuse the same port? There are about 5-10 datagrams sent per second, so we 
run out of resources quite quickly.

Thanks for your help:
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to