Name
StreamConnectionNotifier
Synopsis
StreamConnectionNotifier is a type of
Connection returned when the application invokes the
Connector
open() method with the
name argument of the form socket://:port.
This creates a server socket, which listens for connections from clients and
creates a StreamConnection for each connection received.
Connections can be retrieved by calling the acceptAndOpen()
method, which blocks until a connection is available. Application code will
normally loop through calling this method and creating a new thread to service
each connection. Invoking the StreamConnectionNotifier
close() method causes acceptAndOpen()
to throw an IOException, which can be used to break out of
such a loop.
public interface StreamConnectionNotifier extends Connection {
// Public Instance Methods
public abstract StreamConnection acceptAndOpen(
) throws java.io.IOException;
}
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access