org.jgroups.util
Class TimedWriter
java.lang.Objectorg.jgroups.util.TimedWriter
public class TimedWriter
extends java.lang.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.
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)
|
createSocket
public Socket createSocket(InetAddress local,
InetAddress remote,
int port,
long timeout)
throws Exception,
org.jgroups.util.TimedWriter.Timeout,
InterruptedExceptionTries 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.
main
public static void main(String[] args)
write
public void write(OutputStream out,
byte[] buf,
long timeout)
throws Exception,
org.jgroups.util.TimedWriter.Timeout,
InterruptedExceptionWrites data to an output stream. If the method does not return within timeout milliseconds,
a Timeout exception will be thrown.
write
public void write(OutputStream out,
int i,
long timeout)
throws Exception,
org.jgroups.util.TimedWriter.Timeout,
InterruptedException
Copyright B) 1998-2005 Bela Ban. All Rights Reserved.