git: network - Move socket from netmsg ext to netmsg header, add port to socket
dillon at apollo.backplane.com
Tue Dec 8 12:12:03 PST 2009
:+ * XXX
:+sosetport(struct socket *so, lwkt_port_t port)
:+ so->so_port = port;
:Err. What's the XXX for?
It's a reminder to me to deal with the issue of when the port
has to change... for example, if a TCP connection is disconnected
and connect() is then run on it again to a different target.
Or when connect() is used with UDP, or sendto().
There are issues with those sorts of things where we do not have
a proper abstraction for the case where the port is moved. I did
some very basic work in the netmsg function dispatch code to
check the so->so_port and re-forward the message if it had been
sent to the wrong port (on the assumption that the message was
racing a port change), but it isn't formalized enough or well-tested
enough to be considered stable.
Hence the XXX. Ok, I was a little sparse in my code comment :-)
<dillon at backplane.com>
More information about the Commits