[En-Nut-Discussion] How to use UDP sockets
Hugo Simon
hugo.simon at gmx.de
Mon Jul 7 19:22:09 CEST 2003
Hi Ralph!
Thank you. You gave me the right hint. I always have the same problem with
that Unix sight of the world: The client is the sender. So I got confused
with the docu saying: As a client you have to give a 0 as a port number.
With the right port number it works fine.
The 1500 Byte limit is a little problem. I want to transfer a screenbuffer,
exactly 4kB. First I thought, no problem, split it into four packets. But
then there must be a header which tells me which part of the buffer it is.
Since on both sides client and server the screenbuffer must be ONE large
block of memory I have to do a memcpy to align the bufferblock to the header
and give that to the send/receive routine. But that costs time and thats
bad.
Another option would be to send a magic number in the first part and hope
that the following packets arrive in the same order. I think thats not
sure?!
Any other idea?
Bye
Thorsten
----- Original Message -----
From: Ralph Mason <ralph.mason at telogis.com>
To: <en-nut-discussion at egnite.de>
Sent: Monday, July 07, 2003 7:00 AM
Subject: RE: [En-Nut-Discussion] How to use UDP sockets
> Port 0 is not valid.
>
> Try another port in your NutUdpCreateSocket call (say 10112)
>
> Then from your clients send to the Nut ip address at 10112 (sendto)
>
> Remember the size of a UDP packet is limited the MTU of the network
> (generally around 1500 bytes).
>
> Ralph
More information about the En-Nut-Discussion
mailing list