1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-19 09:22:57 +00:00

New address SOCKETPAIR for echoing datagrams

This commit is contained in:
Gerhard Rieger 2023-09-30 18:30:56 +02:00
parent f152c55584
commit c311542e11
18 changed files with 285 additions and 13 deletions

View file

@ -114,7 +114,11 @@ ssize_t xiowrite(xiofile_t *file, const void *buff, size_t bytes) {
#endif /* _WITH_SOCKET */
case XIOWRITE_PIPE:
writt = Write(pipe->para.bipipe.fdout, buff, bytes);
if (pipe->para.bipipe.socktype == SOCK_STREAM) {
writt = Write(pipe->para.bipipe.fdout, buff, bytes);
} else {
writt = Send(pipe->para.bipipe.fdout, buff, bytes, 0);
}
_errno = errno;
if (writt < 0) {
Error4("write(%d, %p, "F_Zu"): %s",