public class TcpClientConnector extends Object implements org.eclipse.californium.elements.Connector
| Modifier and Type | Field and Description |
|---|---|
protected TcpContextUtil |
contextUtil |
protected org.slf4j.Logger |
LOGGER |
| Modifier | Constructor and Description |
|---|---|
|
TcpClientConnector(int numberOfThreads,
int connectTimeoutMillis,
int idleTimeout) |
protected |
TcpClientConnector(int numberOfThreads,
int connectTimeoutMillis,
int idleTimeout,
TcpContextUtil contextUtil) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
InetSocketAddress |
getAddress() |
String |
getProtocol() |
protected void |
onNewChannelCreated(SocketAddress remote,
io.netty.channel.Channel ch)
Called when a new channel is created, Allows subclasses to add their own
handlers first, like an SSL handler.
|
protected void |
send(io.netty.channel.Channel channel,
org.eclipse.californium.elements.EndpointContextMatcher endpointMatcher,
org.eclipse.californium.elements.RawData msg)
Send message with acquired channel.
|
void |
send(org.eclipse.californium.elements.RawData msg) |
void |
setEndpointContextMatcher(org.eclipse.californium.elements.EndpointContextMatcher matcher) |
void |
setRawDataReceiver(org.eclipse.californium.elements.RawDataChannel messageHandler) |
void |
start() |
void |
stop() |
String |
toString() |
protected final org.slf4j.Logger LOGGER
protected final TcpContextUtil contextUtil
public TcpClientConnector(int numberOfThreads,
int connectTimeoutMillis,
int idleTimeout)
protected TcpClientConnector(int numberOfThreads,
int connectTimeoutMillis,
int idleTimeout,
TcpContextUtil contextUtil)
public void start()
throws IOException
start in interface org.eclipse.californium.elements.ConnectorIOExceptionpublic void stop()
stop in interface org.eclipse.californium.elements.Connectorpublic void destroy()
destroy in interface org.eclipse.californium.elements.Connectorpublic void send(org.eclipse.californium.elements.RawData msg)
send in interface org.eclipse.californium.elements.Connectorprotected void send(io.netty.channel.Channel channel,
org.eclipse.californium.elements.EndpointContextMatcher endpointMatcher,
org.eclipse.californium.elements.RawData msg)
channel - acquired channelendpointMatcher - endpoint matchermsg - message to be sendpublic void setRawDataReceiver(org.eclipse.californium.elements.RawDataChannel messageHandler)
setRawDataReceiver in interface org.eclipse.californium.elements.Connectorpublic void setEndpointContextMatcher(org.eclipse.californium.elements.EndpointContextMatcher matcher)
setEndpointContextMatcher in interface org.eclipse.californium.elements.Connectorpublic InetSocketAddress getAddress()
getAddress in interface org.eclipse.californium.elements.Connectorprotected void onNewChannelCreated(SocketAddress remote, io.netty.channel.Channel ch)
Channel.remoteAddress() is null. To
create a "remote peer" aware SSLEngine, provide the remote address as
additional parameter.remote - remote address the channel will be connected to.ch - new created channelpublic String getProtocol()
getProtocol in interface org.eclipse.californium.elements.ConnectorCopyright © 2021 Eclipse Foundation. All rights reserved.