Constructor and Description |
---|
Sender(Serviceable<E> listener,
Transfer transferListener,
java.net.Socket socket,
int timeout)
Initialize.
|
Modifier and Type | Method and Description |
---|---|
void |
clearQueue()
Clear message queue.
|
void |
close()
Close and clear message queue.
|
java.lang.String |
getIp()
Returns IP address of client.
|
boolean |
isSendClose()
Returns send close of the flag.
|
void |
run() |
void |
send(Data data)
Send data.
|
void |
sendClose(Data data)
Close sender after sending data.
|
void |
setSoTimeout(int timeout)
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
|
public Sender(Serviceable<E> listener, Transfer transferListener, java.net.Socket socket, int timeout) throws java.io.IOException
listener
- close eventtransferListener
- transfersocket
- connectiontimeout
- connection read timeoutjava.io.IOException
- Throw IOException when the connection failed.public void clearQueue()
public void close()
public void run()
run
in interface java.lang.Runnable
public void send(Data data)
public void sendClose(Data data)
public java.lang.String getIp()
public void setSoTimeout(int timeout) throws java.net.SocketException
timeout
- timeoutjava.net.SocketException
- SocketExceptionpublic boolean isSendClose()