Programming in general means you must review code in terms of everything that might go wrong. If something can potentially go wrong then with enough use it eventually WILL go wrong. Network code is even more susceptible to this since communications systems are inherently unstable.
second: you´re not an optimist, right? : P
Robust code will act as though everything might fail and will take an appropriate response in all possible failure cases.
Part of that includes checking return values for error, possibly propagating the error codes if you cannot handle it, and catching exceptions where appropriate.
/Edit: You said you are in Java, remove c-centric error code stuff.