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 TypeMethodDescriptionvoidCalled to establish a new socket connection using the session'sremote address.static Connectordirect()Returns a default connector that directly connects sockets.static Connectorlocal(Environment env) Returns a connector that doesn't establish remote connections, but instead pipes communication directly to accepted sessions of the given environment.static Connectorsecure(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 nullSocketAddresscan be passed to theconnectmethod. -
connect
Called to establish a new socket connection using the session'sremote address. Once established, pass the socket to one of the session'sconnectedmethods. This method can be called by multiple threads concurrently.- Throws:
IOException
-