[twsocket] UDP connection source port - how to set
Hi! 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; end; us.Proto:='udp'; us.Addr:=remoteip[userid]; us.Port:=remoteport[userid]; us.Connect; us.Send(sendbuffer[userid],blocksize[userid]); us.Close; 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: Andras -- 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
[twsocket] UDP datagramreceive periodically freezes for seconds
Hi List, I wrote a little client-server application, which measures UDP datagram transfer speed. The server is using TWSocketServer, and sends a 1500 byte length UDP datagram in every half seconds. The number of datagrams to be sent is a parameter, tipically some 100, below 1000. The client side receive these packets measures the speed (bytes/second) and the counts the missing or lost packets (every packet has an incremental unique id). But on the client side there is a strange behaviour: in about every minute no datagram is coming for some seconds, and after that all of them coming in one bunch, like if emptying some kind of buffer. After that everything returns normal for about another 1 minute. Is it a normal behaviour, or am I doing something wrong? On the server side everything seems to be OK, according to log file every packet is sent with correct timing. Thanks for your help: Andras -- 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
RE: [twsocket] UDP datagramreceive periodically freezes for seconds
Sorry, it was my fault, the UDP datagrams are sent with a TWSocket, not a TWSocketServer. TWSocket has a property: FlushTimeOut, which is set to 60, but in the help file I didn't find anything about it. What does this property do? The listening TWSocket DataAvailable method is the following (partly from the example project bound to ICS): procedure Tmainform.udplistenDataAvailable(Sender: TObject; Error: Word); var Len: Integer; Src: TSockAddrIn; SrcLen : Integer; begin SrcLen := SizeOf(Src); Len:= udplisten.ReceiveFrom(@incomingbuff, SizeOf(incomingbuff), Src, SrcLen); incomingsize:=len; if Len >= 0 then begin if (FServerAddr.S_addr = INADDR_ANY)or(FServerAddr.S_addr = Src.Sin_addr.S_addr) then begin workwithincomingdata(inet_ntoa(Src.sin_addr),ntohs(Src.sin_port),incomingbuff,len); end; end; end; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: Thursday, March 17, 2005 9:12 PM To: ICS support mailing Subject: Re: [twsocket] UDP datagramreceive periodically freezes for seconds Hello Udvari, TWSocketServer does not handle UDP, only TCP. --- Rgds, Wilfried http://www.mestdagh.biz Thursday, March 17, 2005, 16:28, Udvari András László wrote: > Hi List, > I wrote a little client-server application, which measures UDP > datagram transfer speed. The server is using TWSocketServer, and sends > a 1500 byte length UDP datagram in every half seconds. The number of > datagrams to be sent is a parameter, tipically some 100, below 1000. > The client side receive these packets measures the speed > (bytes/second) and the counts the missing or lost packets (every > packet has an incremental unique id). > But on the client side there is a strange behaviour: in about every > minute no datagram is coming for some seconds, and after that all of > them coming in one bunch, like if emptying some kind of buffer. After > that everything returns normal for about another 1 minute. > Is it a normal behaviour, or am I doing something wrong? On the > server side everything seems to be OK, according to log file every > packet is sent with correct timing. > Thanks for your help: > Andras > -- > 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 -- 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 -- 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
RE: [twsocket] UDP datagramreceive periodically freezes for seconds
Thanks, but it has the same behaviour with 1100 byte long packets, which is well under the size of the MTU. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marcello Vezzelli Sent: Thursday, March 17, 2005 5:17 PM To: ICS support mailing Subject: Re: [twsocket] UDP datagramreceive periodically freezes for seconds Udvari András László ha scritto: > Hi List, > > I wrote a little client-server application, which measures UDP datagram > transfer speed. The server is using TWSocketServer, and sends a 1500 byte > length UDP datagram in every half seconds. The number of datagrams to be sent > is a parameter, tipically some 100, below 1000. The client side receive these > packets measures the speed (bytes/second) and the counts the missing or lost > packets (every packet has an incremental unique id). > > But on the client side there is a strange behaviour: in about every minute no > datagram is coming for some seconds, and after that all of them coming in one > bunch, like if emptying some kind of buffer. After that everything returns > normal for about another 1 minute. > > Is it a normal behaviour, or am I doing something wrong? On the server side > everything seems to be OK, according to log file every packet is sent with > correct timing. You should pay attention to the maximum MTU of your network, which is likely to be lower than 1500. One explanation to your problem could be that some network device (could be windows network layer too) waits for UDP fragments then sends reconstructed packets in a short time. Try to lower packet size to 1400, or exactly to your network MTU. -- Marcello Vezzelli CTO Software Development Department E-Works s.r.l. tel. +39 059 2929081 fax +39 059 2925035 Direzionale 70 - Via Giardini 456/c 41100 Modena - Italy -- 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 -- 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
FW: [twsocket] UDP datagramreceive periodically freezes for seconds
Anybody has any other idea, in which direction should I look for the solution? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Udvari András László Sent: Friday, March 18, 2005 8:26 AM To: ICS support mailing Subject: RE: [twsocket] UDP datagramreceive periodically freezes for seconds Sorry, it was my fault, the UDP datagrams are sent with a TWSocket, not a TWSocketServer. The listening TWSocket DataAvailable method is the following (partly from the example project bound to ICS): procedure Tmainform.udplistenDataAvailable(Sender: TObject; Error: Word); var Len: Integer; Src: TSockAddrIn; SrcLen : Integer; begin SrcLen := SizeOf(Src); Len:= udplisten.ReceiveFrom(@incomingbuff, SizeOf(incomingbuff), Src, SrcLen); incomingsize:=len; if Len >= 0 then begin if (FServerAddr.S_addr = INADDR_ANY)or(FServerAddr.S_addr = Src.Sin_addr.S_addr) then begin workwithincomingdata(inet_ntoa(Src.sin_addr),ntohs(Src.sin_port),incomingbuff,len); end; end; end; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: Thursday, March 17, 2005 9:12 PM To: ICS support mailing Subject: Re: [twsocket] UDP datagramreceive periodically freezes for seconds Hello Udvari, TWSocketServer does not handle UDP, only TCP. --- Rgds, Wilfried http://www.mestdagh.biz Thursday, March 17, 2005, 16:28, Udvari András László wrote: > Hi List, > I wrote a little client-server application, which measures UDP > datagram transfer speed. The server is using TWSocketServer, and sends > a 1500 byte length UDP datagram in every half seconds. The number of > datagrams to be sent is a parameter, tipically some 100, below 1000. > The client side receive these packets measures the speed > (bytes/second) and the counts the missing or lost packets (every > packet has an incremental unique id). > But on the client side there is a strange behaviour: in about every > minute no datagram is coming for some seconds, and after that all of > them coming in one bunch, like if emptying some kind of buffer. After > that everything returns normal for about another 1 minute. > Is it a normal behaviour, or am I doing something wrong? On the > server side everything seems to be OK, according to log file every > packet is sent with correct timing. > Thanks for your help: > Andras > -- > 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 -- 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 -- 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 -- 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
RE: [twsocket] UDP datagram receive periodically freezes for seconds... The saga continues
Hi! I made some further investigation, did the following: I made the following setup: 1000 packets to be sent without any delay between them, every packet is 1100 bytes long, and the following network conditions: 1. Client-server is on the same computer (localhost) 2. Client-server on different computer, 100Mbit network intranet connection 3. Client-server on different computer, GPRS (EDGE) intranet connection On the first case there was no problem, everything worked fine. On the 2nd and 3rd case my program was unable to detect most of the packets (in case 2 about 200 of 1000 were detected on the client side, in the 3rd case less than 100). The OnDataAvailable method of TWSocket I use for detecting the datagrams: procedure Tmainform.udplistenDataAvailable(Sender: TObject; Error: Word); var Len: Integer; Src: TSockAddrIn; SrcLen : Integer; begin SrcLen := SizeOf(Src); Len:= udplisten.ReceiveFrom(@incomingbuff, SizeOf(incomingbuff), Src,SrcLen); incomingsize:=len; if Len >= 0 then begin if (FServerAddr.S_addr = INADDR_ANY)or(FServerAddr.S_addr =Src.Sin_addr.S_addr) then begin workwithincomingdata(inet_ntoa(Src.sin_addr),ntohs(Src.sin_port),incomingbuff,len); end; end; end; I used Ethereal for viewing the incoming data, and all (or at least most of) the UDP packets was received according to Ethereal, but my program was unable to capture them. What am I doing wrong? Or is it a normal behaviour? Thanks for your help: Andras -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Francois PIETTE Sent: Saturday, March 19, 2005 2:45 PM To: ICS support mailing Subject: Re: [twsocket] UDP datagramreceive periodically freezes for seconds Use a sniffer to see if the datagrams are really sent by your program. If they are sent, it means you have a device that drop packets, maybe when his buffer if full. You can use the free sniffer Ethereal (link on the links page at my website). If the datagrams are not sent, then there is something wrong on your computer or program. Much more difficult to know what. You should first try the exe on another computer to see what happend. Remember UDP is by design a non reliable protocol. -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: "Udvari András László" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Saturday, March 19, 2005 1:52 PM Subject: FW: [twsocket] UDP datagramreceive periodically freezes for seconds > Anybody has any other idea, in which direction should I look for the solution? > > > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Udvari András László > Sent: Friday, March 18, 2005 8:26 AM > To: ICS support mailing > Subject: RE: [twsocket] UDP datagramreceive periodically freezes for seconds > > Sorry, it was my fault, the UDP datagrams are sent with a TWSocket, not a TWSocketServer. > > > The listening TWSocket DataAvailable method is the following (partly from the example project bound to ICS): > > procedure Tmainform.udplistenDataAvailable(Sender: TObject; Error: Word); > var Len: Integer; > Src: TSockAddrIn; > SrcLen : Integer; > begin > SrcLen := SizeOf(Src); > Len:= udplisten.ReceiveFrom(@incomingbuff, SizeOf(incomingbuff), Src, SrcLen); > incomingsize:=len; > if Len >= 0 then > begin > if (FServerAddr.S_addr = INADDR_ANY)or(FServerAddr.S_addr = Src.Sin_addr.S_addr) then > begin > workwithincomingdata(inet_ntoa(Src.sin_addr),ntohs(Src.sin_port),incomingbuf f,len); > end; > end; > end; > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh > Sent: Thursday, March 17, 2005 9:12 PM > To: ICS support mailing > Subject: Re: [twsocket] UDP datagramreceive periodically freezes for seconds > > Hello Udvari, > > TWSocketServer does not handle UDP, only TCP. > > --- > Rgds, Wilfried > http://www.mestdagh.biz > > Thursday, March 17, 2005, 16:28, Udvari András László wrote: > > > Hi List, > > > I wrote a little client-server application, which measures UDP > > datagram transfer speed. The server is using TWSocketServer, and sends > > a 1500 byte length UDP datagram in every half seconds. The number of > > datagrams to be sent is a parameter, tipically some 100, below 1000. > > The client side receive these packets measures the speed > > (bytes/second) and the counts the missing or lost packets (every > > packet has an incremental unique id). > > > But on the client side there is a strange behaviour: in about every > > minute no datagram is coming for some seconds, and after that all of > > them comin
[twsocket] FTP Connection Timeout - how to change
Hi! I have a slow FTP connection (typically the connection lasts about 60 sec using for example Total Commander). I tried to connect using ICS FTP component, but after about 15 sec I receive "Error code 10060 - Connection Timed out". I changed the timeout property of the FTP component to 60, but no changes were seen. Where can I set the timeout value for FTP connection? Thanks: Andras -- 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
RE: [twsocket] FTP Connection Timeout - how to change
Thank you, I will inspect my settings, because in this machine other FTP programs failed, too. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Francois Piette Sent: Thursday, April 14, 2005 11:45 AM To: ICS support mailing Subject: Re: [twsocket] FTP Connection Timeout - how to change > I have a slow FTP connection (typically the connection lasts about 60 sec > using for example Total Commander). I tried to connect using ICS FTP component, but after about 15 sec I receive "Error code 10060 - Connection Timed out". > I changed the timeout property of the FTP component to 60, but no changes > were seen. > > Where can I set the timeout value for FTP connection? Error 10060 is a winsock generated error. There is nothing you can do about it from the component. You have to change TCP/IP registry leys to adapt the timeouts. Note that 15 sec timeout is not the standard winsock timeout. I suspect you have already tweaked the registry. Or maybe you have some kind of personal firewall installed that to this kind of things. -- [EMAIL PROTECTED] http://www.overbyte.be -- 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 -- 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
[twsocket] FTPCLI - how to query/change FTP send buffer size?
Hi! If I use the ICS FTPCLI component, how can I query/set the size of the FTP send buffer? I mean the SO_SNDBUF parameter, required by our test method, to simulate certain test cases in wireless environment. Thanks: Andras -- 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
Re: [twsocket] FTPCLI - how to query/change FTP send buffer size?
Thanks for your reply. And how can I query the current settings? At the first stage our test I need only the current value. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Francois Piette Sent: Wednesday, December 07, 2005 4:06 PM To: ICS support mailing Subject: Re: [twsocket] FTPCLI - how to query/change FTP send buffer size? Not easy. You must change the component and call WSocket_setsockopt with the correct parameters at the right place ! The right place is in TCustomWSocket.Connect and TCustomWSocket.Dup -- [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be - Original Message - From: "Udvari András László" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Wednesday, December 07, 2005 2:36 PM Subject: [twsocket] FTPCLI - how to query/change FTP send buffer size? > Hi! > > If I use the ICS FTPCLI component, how can I query/set the size of the FTP > send buffer? I mean the SO_SNDBUF parameter, required by our test method, to simulate certain test cases in wireless environment. > > Thanks: > Andras > -- > 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 -- 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 -- 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
Re: [twsocket] FTPCLI - how to query/change FTP send buffer size?
Hi Francois, Using your directions I succeeded to query and change the SO_SNDBUF. I chose the TCustomWinSocket.Dup procedure to do the following: 1. Query the SO_SNDBUF (result was 8192) 2. Set the SO_SNDBUF to 16384 3. Query once again (and yes, the result was now 16384 :)) Two questions remain: 1. Is there any difference if I do these changes in TCustomWinSocket.Connect or in TCustomWinSocket.Dup? 2. When I set the new SO_SNDBUF value before an upload to 16384, after finishing this upload, and beginning a new one, the value was once again 8192. Is it a normal behaviour that I have to set the send buffer size explicitly before every upload? Thanks for your help: Andras Udvari -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Francois PIETTE Sent: Wednesday, December 07, 2005 8:16 PM To: ICS support mailing Subject: Re: [twsocket] FTPCLI - how to query/change FTP send buffer size? >> Not easy. You must change the component and call WSocket_setsockopt >> with the correct parameters at the right place ! The right place is in >> TCustomWSocket.Connect and TCustomWSocket.Dup > Thanks for your reply. And how can I query the current settings? > At the first stage our test I need only the current value. Just have a look at the source code where I told you to insert code and you'll quickly understand. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be -- 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 -- 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