Why set a socket to blocking after setting SO_LINGER values?
up vote
1
down vote
favorite
I'm looking at some proprietary legacy code that is setting a non blocking socket to blocking after doing the following.
lbuf.l_onoff = 1;
lbuf.l_linger = 0;
e = setsockopt(s->s_fd, SOL_SOCKET,
SO_LINGER, (optvalp)&lbuf, sizeof(lbuf));
Any thoughts why this might be needed either now or in the past ?
Code has supported Windows, Unixware, and Solaris in the past. Currently running on CentOs linux.
linux sockets unix solaris
add a comment |
up vote
1
down vote
favorite
I'm looking at some proprietary legacy code that is setting a non blocking socket to blocking after doing the following.
lbuf.l_onoff = 1;
lbuf.l_linger = 0;
e = setsockopt(s->s_fd, SOL_SOCKET,
SO_LINGER, (optvalp)&lbuf, sizeof(lbuf));
Any thoughts why this might be needed either now or in the past ?
Code has supported Windows, Unixware, and Solaris in the past. Currently running on CentOs linux.
linux sockets unix solaris
2
What functions are being called to flush the socket?
– Jeremy Friesner
Nov 8 at 23:13
I'm also at a loss as to what you mean by "flushing the socket". The concept of "flushing a socket" isn't generally implemented. See en.wikipedia.org/wiki/Berkeley_sockets
– Andrew Henle
Nov 9 at 15:19
@JeremyFriesner . I edited the question to show the actual code.
– Chaim Geretz
Nov 9 at 19:19
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm looking at some proprietary legacy code that is setting a non blocking socket to blocking after doing the following.
lbuf.l_onoff = 1;
lbuf.l_linger = 0;
e = setsockopt(s->s_fd, SOL_SOCKET,
SO_LINGER, (optvalp)&lbuf, sizeof(lbuf));
Any thoughts why this might be needed either now or in the past ?
Code has supported Windows, Unixware, and Solaris in the past. Currently running on CentOs linux.
linux sockets unix solaris
I'm looking at some proprietary legacy code that is setting a non blocking socket to blocking after doing the following.
lbuf.l_onoff = 1;
lbuf.l_linger = 0;
e = setsockopt(s->s_fd, SOL_SOCKET,
SO_LINGER, (optvalp)&lbuf, sizeof(lbuf));
Any thoughts why this might be needed either now or in the past ?
Code has supported Windows, Unixware, and Solaris in the past. Currently running on CentOs linux.
linux sockets unix solaris
linux sockets unix solaris
edited Nov 9 at 19:17
asked Nov 8 at 22:58
Chaim Geretz
508318
508318
2
What functions are being called to flush the socket?
– Jeremy Friesner
Nov 8 at 23:13
I'm also at a loss as to what you mean by "flushing the socket". The concept of "flushing a socket" isn't generally implemented. See en.wikipedia.org/wiki/Berkeley_sockets
– Andrew Henle
Nov 9 at 15:19
@JeremyFriesner . I edited the question to show the actual code.
– Chaim Geretz
Nov 9 at 19:19
add a comment |
2
What functions are being called to flush the socket?
– Jeremy Friesner
Nov 8 at 23:13
I'm also at a loss as to what you mean by "flushing the socket". The concept of "flushing a socket" isn't generally implemented. See en.wikipedia.org/wiki/Berkeley_sockets
– Andrew Henle
Nov 9 at 15:19
@JeremyFriesner . I edited the question to show the actual code.
– Chaim Geretz
Nov 9 at 19:19
2
2
What functions are being called to flush the socket?
– Jeremy Friesner
Nov 8 at 23:13
What functions are being called to flush the socket?
– Jeremy Friesner
Nov 8 at 23:13
I'm also at a loss as to what you mean by "flushing the socket". The concept of "flushing a socket" isn't generally implemented. See en.wikipedia.org/wiki/Berkeley_sockets
– Andrew Henle
Nov 9 at 15:19
I'm also at a loss as to what you mean by "flushing the socket". The concept of "flushing a socket" isn't generally implemented. See en.wikipedia.org/wiki/Berkeley_sockets
– Andrew Henle
Nov 9 at 15:19
@JeremyFriesner . I edited the question to show the actual code.
– Chaim Geretz
Nov 9 at 19:19
@JeremyFriesner . I edited the question to show the actual code.
– Chaim Geretz
Nov 9 at 19:19
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53217432%2fwhy-set-a-socket-to-blocking-after-setting-so-linger-values%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
What functions are being called to flush the socket?
– Jeremy Friesner
Nov 8 at 23:13
I'm also at a loss as to what you mean by "flushing the socket". The concept of "flushing a socket" isn't generally implemented. See en.wikipedia.org/wiki/Berkeley_sockets
– Andrew Henle
Nov 9 at 15:19
@JeremyFriesner . I edited the question to show the actual code.
– Chaim Geretz
Nov 9 at 19:19