org.jgroups.util
Class TimedWriter
public
class
TimedWriter
extends Object
Waits until the buffer has been written to the output stream, or until timeout msecs have elapsed,
whichever comes first.
TODO: make it more generic, so all sorts of timed commands should be executable. Including return
values, exceptions and Timeout exception. Also use ReusableThread instead of creating a new threa
each time.
Author: Bela Ban
Method Summary |
Socket | createSocket(InetAddress local, InetAddress remote, int port, long timeout) Tries to create a socket to remote_peer:remote_port. |
static void | main(String[] args) |
void | write(OutputStream out, byte[] buf, long timeout)
Writes data to an output stream. |
void | write(OutputStream out, int i, long timeout) |
public Socket createSocket(InetAddress local, InetAddress remote, int port, long timeout)
Tries to create a socket to remote_peer:remote_port. If not sucessful within timeout
milliseconds, throws the Timeout exception. Otherwise, returns the socket or throws an
IOException.
public static void main(String[] args)
public void write(OutputStream out, byte[] buf, long timeout)
Writes data to an output stream. If the method does not return within timeout milliseconds,
a Timeout exception will be thrown.
public void write(OutputStream out, int i, long timeout)
Copyright ? 1998-2005 Bela Ban. All Rights Reserved.