Fork us on GitHub Follow us on Facebook Follow us on Twitter

Opened 6 years ago

Closed 3 years ago

#522 closed enhancement (worksforme)

Implement sendto() and recvfrom() for TCP

Reported by: Martin Decky Owned by: Jiri Svoboda
Priority: minor Milestone: 0.7.0
Component: helenos/net/tcp Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:


Although not used frequently, even SOCK_STREAM sockets can support sendto() and recvfrom() calls (with proper arguments).

Change History (6)

comment:1 Changed 6 years ago by Jiri Svoboda

Do you have any documentation which would describe how that should behave? Or at least any ideas?

comment:2 Changed 6 years ago by Martin Decky

The Linux man page for send(2) states:

If sendto() is used on a connection-mode (SOCK_STREAM, SOCK_SEQPACKET) socket,
the arguments dest_addr and addrlen are ignored (and the error EISCONN may be
returned when they are not NULL and 0), and the error ENOTCONN is returned when
the socket was not actually connected. Otherwise, the address of the target is
given by dest_addr with addrlen specifying its size.

Similarly, the Linux man page for recv(2) states:

The recv() call is normally used only on a connected socket (see connect(2)) and
is identical to recvfrom() with a NULL src_addr argument.

I don't consider this as a "canonical" behaviour in any sense, but I believe it cannot hurt anything.

comment:3 Changed 6 years ago by Jiri Svoboda

For comparison, the Solaris man pages, although they seem to indicate that it is possible to use sendto() and recvfrom() on a stream socket, they don't say anything about what it actually does.

comment:4 Changed 5 years ago by Jakub Jermář


comment:5 Changed 3 years ago by Jakub Jermář

Is this still relevant now that we don't use the almost BSD sockets?

comment:6 Changed 3 years ago by Jiri Svoboda

Resolution: worksforme
Status: newclosed

No, it's not.

Note: See TracTickets for help on using tickets.