> 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
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
> 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
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
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,
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
> 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
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
> 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
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
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
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
> 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
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
> 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
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
16 matches
Mail list logo