***About UDP, indeed there are sockets, but it's a connectionless
protocol, I'm
not sure you have to store some information, like some kind of session
or
the like. When you receive a UDP datagram, don't you have every piece
of
information to deal with it ?

Yes, it is a connectionless protocol, but I think the meaning of that
is you don't need both sides to confirm that the connection is there.
There is no acknowledgment from the other side when you send data, you
just send it and hope it gets there. However, you may want to remember
who you sent the data to in case of further communication.

Let's say we get a callback to udp_receive_callback(). I could allow
the user to specify what ip address to reply to, but what's the point?
you will obviously want to reply to whoever sent you the packet and
not to anyone else, and also to the correct port number. So, UDP lib
creates a socket, then it passes the socket number to the user. When
the user wants to reply they only need to specify a socket. At the end
of the callback, the user can delete the socket. If someone wishes,
they can make a timeout for their sockets (I think TCP does this
automatically). Of course, they could keep the socket if they are
transferring a file.

If you take a look at the current callback procedure, you would have
to replace all instances of var "socket" with vars for ip address,
source port and destination port.

Also note that I currently have udp_socket_connect() and
udp_socket_disconnect() in the main loop, but they do not need to be.
You can do udp_socket_connect() before the loop and then never do
disconnect. (maybe I need to rename these to udp_socket_create and
udp_socket_delete)

Maybe you'll see when you try it.

TFTP looks like a nice light file transfer protocol for UDP

Matt.

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to