keepalive.communication
Interface Sender
- All Known Implementing Classes:
- Output
- public interface Sender
An object that knows how to send a message.
Method Summary |
void |
close()
Closes socket without rethrowing IOException. |
long |
lastTimeStamp()
Get the last time data was sent. |
void |
send(java.lang.String s)
Send the given String. |
send
public void send(java.lang.String s)
throws java.io.IOException
- Send the given String.
- Parameters:
s
- the String to send.- Throws:
java.io.IOException
- if an I/O error occurs.
lastTimeStamp
public long lastTimeStamp()
- Get the last time data was sent.
- Returns:
- when data was last sent, in milliseconds since the epoch. If
data has not yet been sent, return the time of instantiation of this
Object.
close
public void close()
- Closes socket without rethrowing IOException.
The Keep-Alives close this Sender when they detect a communication
failure. Closing the Sender also closes the Receiver, so that the
entire connection to the client is cleaned up.
This demo application just closes the socket; in your application
you might also close database connections devoted to servicing the
client, remove table entries referring to the client, etc.