setsockopt() SO_LINGER and immediate close socket

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi,

set_linger.l_onoff = 1;
set_linger.l_linger = 0;
setsockopt(sockfd, SOL_SOCKET, SO_LINGER, (char *)&set_linger,
sizeof(set_linger));

After call:

shutdown(fd, SD_BOTH);
closesocket(fd);

I will immediate close socket. But socket not close because in output buffer
is not send data. I will discards data in output buffer and send RESET
connection. In Linux and Wine work before setup SO_LINGER correct. What not
work correct in Windows?

Thanks for answer.

Best regards Jan Fuchs
.



Relevant Pages

  • Re: CGI written in C
    ... "Roman Mashak" writes: ... > RH> make sure that the output buffer gets written to the socket. ... > in CGI? ...
    (comp.unix.programmer)
  • Re: [PATCH 2.6.23-rc6 Resending] NETWORKING : Edge Triggered EPOLLOUT events get missed for TCP
    ... SOCK_NOSPACE bit is set in the socket flags. ... take care of all possible scenarios in which a user can convey his intent ... tcp_sendmsg detects lack of sndbuf space ... (free space on the output buffer), if you do not consume it (say a ...
    (Linux-Kernel)
  • Re: Non blocking socket query.
    ... > data buffer for each socket connection. ... containing output buffer, status info etc). ... want to prevent remote applications sending data to me. ...
    (comp.unix.programmer)