Re: [twsocket] Delphi2007,UDP, 2x packets

2007-09-12 Thread Tobias Rapp
> How do you manage missed/double/wrong ordered packets? Each packet got some sequence ID and "alive packets" were sent from time to time. Also there was no special acknowledge packet - each received packet contained the last successful received ID of the sender. If one side detects that an incom

Re: [twsocket] Delphi2007,UDP, 2x packets

2007-09-12 Thread brian
Yeah, I've worked a lot with TCP and it was really no problem requesting a next packet after each, it was very fast. UDP offers some other valuable features though. How do you manage missed/double/wrong ordered packets? I thought of making a buffer to store a certain amount of packets.. say... m

Re: [twsocket] Delphi2007,UDP, 2x packets

2007-09-11 Thread Tobias Rapp
> it seems acknowledging every packet with udp before sending more turns out > much slower than tcp That doesn't surprise me because TCP allows to acknowledge multiple received packets/frames at once, sends out multiple frames before waiting for an acknowledge, ... If you need acknowledges just

Re: [twsocket] Delphi2007,UDP, 2x packets

2007-09-11 Thread brian
Thanks, that's really helpful! (only missed the pointer to the buffer in that code) it seems acknowledging every packet with udp before sending more turns out much slower than tcp -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/lis

Re: [twsocket] Delphi2007,UDP, 2x packets

2007-09-11 Thread Wilfried Mestdagh
Hello Brian, Not tested. This echo back a received packet from a listening UDP socket to the other end: var Buffer: array [0..1023] of char; Len: integer; Src: TSockAddrIn; SrcLen: integer; begin SrcLen := SizeOf(Src); Len := FUDPServer.ReceiveFrom(@Buffer, SizeOf(Buffer), Src,

Re: [twsocket] Delphi2007,UDP, 2x packets

2007-09-11 Thread brian
Hi, I checked it out, that's quite confusing heh. I'd appreciate it if you could show me a simple code for a UDP wsocket to Listen; and send data back to the host it received from. Thanks! -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/ma

Re: [twsocket] Delphi2007,UDP, 2x packets

2007-09-09 Thread Angus Robertson - Magenta Systems Ltd
> Can I send data back with the same udp socket that I set to listen? Yes. Look at my IP Log Streaming Component using ICS, it includes a demo for that can acts as TCP or UDP, client or server, bouncing packets around. http://www.magsys.co.uk/delphi/magics.asp Angus -- To unsubscribe or ch

Re: [twsocket] Delphi2007,UDP, 2x packets

2007-09-09 Thread brian
I think I figured out the problem. The first socket is sending out faster than the receiver is receiving and flushing the buffer. Another question, if I may; Can I send data back with the same udp socket that I set to listen? -- To unsubscribe or change your settings for TWSocket mailing list

Re: [twsocket] Delphi2007,UDP, 2x packets

2007-09-09 Thread Francois PIETTE
> sorry, actually it's this > > procedure TForm1.WSocket2DataAvailable(Sender: TObject; ErrCode: Word); > Var a: string; > begin > a:= WSocket2.ReceiveStr; > // if length(a) = 0 then Exit; > Inc(rec,1); > caption:= 'Received packets = '+inttostr(rec); > memo1.lines.add('Data: '+a); > end; You ha

Re: [twsocket] Delphi2007,UDP, 2x packets

2007-09-09 Thread brian
sorry, actually it's this procedure TForm1.WSocket2DataAvailable(Sender: TObject; ErrCode: Word); Var a: string; begin a:= WSocket2.ReceiveStr; // if length(a) = 0 then Exit; Inc(rec,1); caption:= 'Received packets = '+inttostr(rec); memo1.lines.add('Data: '+a); end; -- To unsubscribe or c

Re: [twsocket] Delphi2007,UDP, 2x packets

2007-09-09 Thread brian
This is the simple test code to receive the data procedure TForm1.WSocket1DataAvailable(Sender: TObject; ErrCode: Word); begin Inc(rec,1); caption:= 'Received packets = '+inttostr(rec); memo1.lines.add(WSocket2.ReceiveStr); end; > Are you calling the message pump from one of your event

Re: [twsocket] Delphi2007,UDP, 2x packets

2007-09-09 Thread Wilfried Mestdagh
Hello brian, > I thought the fragmented packets didn't happen with UDP though? that > boundaries were respected? Yes boundaries are respected with UDP. Don't make your packets too large. Look at internal buffer of TWSocket. > Why is the event triggered with empty data? I don't know. Using TCP j

Re: [twsocket] Delphi2007,UDP, 2x packets

2007-09-09 Thread Francois PIETTE
> I thought the fragmented packets didn't happen with UDP though? that > boundaries were respected? At the application level, there is no fragmented packet, datagram boundaries are respected. > Why is the event triggered with empty data? Are you calling the message pump from one of your event h

Re: [twsocket] Delphi2007,UDP, 2x packets

2007-09-08 Thread brian
Yes they are 0 bytes I thought the fragmented packets didn't happen with UDP though? that boundaries were respected? When I used TCP I made packet delimiters so I could identify when I had a full packet in various pieces, but isn't that different with UDP? Why is the event triggered with empty

Re: [twsocket] Delphi2007,UDP, 2x packets

2007-09-08 Thread Angus Robertson - Magenta Systems Ltd
> I know I am to expect this behaviour, incorrect order, missing > packets, receiving the same packet twice, but blank packets with no > data? If you mean the packet is zero length, it's not actually a packet atall is it. Remember SocketDataAvailable is triggered when any data is available, a

[twsocket] Delphi2007,UDP, 2x packets

2007-09-08 Thread brian
Hello, I am using Delphi and ICS again after a few years of not doing much network stuff, and I've begun working on a project involving UDP, so my first steps are doing some testing. I setup a udp socket and send 100 packs with a message and an identified number, and the receiver counts the pa