There's much more to this than the OP realizes:
1) if the server is down before the client could establish a connection,
the client has to keep retrying to make a connection.
2) if the server goes down while the client was waiting/reading for some
data, the connection is lost, the partial data must be kept or thrown
away depending on the communication protocol and the client should
repeat step 1) again.
3) if the server goes down while the client was writing to the server, the
write fails and the entire shebang should be restarted at step 1) again.
Personally I wouldn't bother and simply spit out a "connection lost,
please try again later" towards the general direction of the user.
kind regards,
Jos