Interface Connector
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Defines a function which is called whenever client-side socket connections need to be
established.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called to establish a new socket connection using the session'sremote address
.static Connector
direct()
Returns a default connector that directly connects sockets.static Connector
local
(Environment env) Returns a connector that doesn't establish remote connections, but instead pipes communication directly to accepted sessions of the given environment.static Connector
secure
(SSLContext context) Returns a connector that directly connects sockets over TLS/SSL.
-
Method Details
-
direct
Returns a default connector that directly connects sockets. -
secure
Returns a connector that directly connects sockets over TLS/SSL.- Parameters:
context
- can pass null to use the default
-
local
Returns a connector that doesn't establish remote connections, but instead pipes communication directly to accepted sessions of the given environment. This type of connector is mostly useful for testing purposes. Note that it completely ignores socket addresses, and so a nullSocketAddress
can be passed to theconnect
method. -
connect
Called to establish a new socket connection using the session'sremote address
. Once established, pass the socket to one of the session'sconnected
methods. This method can be called by multiple threads concurrently.- Throws:
IOException
-