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...

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

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

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),

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

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

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

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 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

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