Client Server Disconnect

One of the biggest problems in socket programming is discovering when one end or the other crashes and does not properly shutdown its connection or when the network is broken between the two nodes.

Typically one would catch the IOException that results from attempting to write to such a connection.

What I want to know is if socket.sendUrgentData would behave the same way? Would it result in an IOException if the other end of the socket was not responding? Since I can have both ends discard that urgent data (aka thats what it does by default) when they are both responding it would make it a more ideal candidate for psuedo pinging.

Any comments?

[676 byte] By [floersha] at [2007-10-2 14:16:53]
# 1

> What I want to know is if socket.sendUrgentData would

> behave the same way? Would it result in an

RTFM

"Send one byte of urgent data on the socket. The byte to be sent is the lowest eight bits of the data parameter. The urgent byte is sent after any preceding writes to the socket OutputStream and before any future writes to the OutputStream.

Parameters:

data - The byte of data to send

Throws:

IOException - if there is an error sending the data."

So it seems like yes it would throw an IOException.

tjacobs01a at 2007-7-13 12:33:20 > top of Java-index,Java Essentials,Java Programming...