Re: send() on socket when network is disconnected
Re: send() on socket when network is disconnected
- Subject: Re: send() on socket when network is disconnected
- From: Josh Graessley <email@hidden>
- Date: Mon, 28 Aug 2006 10:48:24 -0700
Eek, major typo.
Correction:
Intermittent problems should NOT kill a connection.
Sorry about that.
-josh
On Aug 28, 2006, at 10:31 AM, Josh Graessley wrote:
What sort of socket are you talking about? If this is a TCP socket
that has already been connected, this is effectively the expected
behavior. Sounds silly, doesn't it.
There is this notion that intermittent problems should kill a
connection. If the TCP connection has been established then there
was connectivity at some point, and there may again be
connectivity. You could, in theory, telnet in to a machine on the
network from a laptop, disconnect the laptop, take it to a meeting,
walk back, connect the laptop to the network again, and continue
your telnet session. This behavior is perhaps desirable for some
situations. You can use the SO_NOADDRERR socket option to change
this behavior. If you set this socket option, you socket will be
closed when you try to write to it and the source address is no
longer available.
After your application writes data on the socket, the stack will
try to send that data. If the data doesn't receive any
acknowledgment for some long period of time, the socket will
determine the other side is unreachable and mark the socket as
disconnected. Writes from this point on will result in an error.
-josh
On Aug 28, 2006, at 6:01 AM, Basavaraj Pujar wrote:
Hello,
Problem:
send() on socket return successfully the number of
bytes we had given,
eventhough network is disconnected.
I connected to destination through a socket, if
network is there everything works fine. If I remove
network, and do send on the connected socket,
eventhough send doesn't return 0 or error ? How?
But Windows sockets is returning -1 error for the same
situation.
Thank you for reading my problem, please reply me back
if you have answers or suggestions.
Regards,
Basavaraj
__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden