is there any other way? methods that throw IOException usually require data being sent thorugh the socket. Is there any method that i can call without actually sending data that i will be able to catch the IOException? thanks hang on a sec.. if i pass a syncronised socketWriter (one i made) class to the thread... then i won't get sync probs and i should be able to catch the IOException without probs.. thanks again sampathkumar rangarajan <[EMAIL PROTECTED]> wrote: > Hi Rob > When you are connecting to a server thru socket,if > it is not connected it will throw exception.So catch > the exception and reconnect it. > > bye > Rangarajan.S > > --- Rob Hazlewood <[EMAIL PROTECTED]> wrote: > > can anyone tell me how i can determine if a socket > > is connected in java?? > > > > I need to get a servlet to connect to a server and i > > am writing a thread which > > checks if socket is connected, and if it isn't the > > thread reconnects. > > > > I'd rather not send much data through the socket, as > > it will be in use by > > other threads. > > > > I found that Socket.getInetAddress sends the > > information of the server it is > > or was connected to (damn) > > > > thanks > > Rob > > > > > ____________________________________________________________________ > > Get free email and a permanent address at > > http://www.netaddress.com/?N=1 > > > > > ___________________________________________________________________________ > > To unsubscribe, send email to [EMAIL PROTECTED] > > and include in the body > > of the message "signoff SERVLET-INTEREST". > > > > Archives: > > > http://archives.java.sun.com/archives/servlet-interest.html > > Resources: > > > http://java.sun.com/products/servlet/external-resources.html > > LISTSERV Help: > > http://www.lsoft.com/manuals/user/user.html > > > ____________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk > or your free @yahoo.ie address at http://mail.yahoo.ie ____________________________________________________________________ Get free email and a permanent address at http://www.netaddress.com/?N=1 ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
