|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.comm.AbstractConnection
com.kuka.comm.net.NetConnection
public abstract class NetConnection
Abstract subclass which names the generic type for an AbstractConnection regarding to network specific use of
ByteBuffer.
| Field Summary | |
|---|---|
protected byte[] |
_inputBuffer
A buffer that can be used to store bytes from an input stream of the connection. |
protected InetSocketAddress |
_localAddress
The local connection address. |
protected byte[] |
_outputBuffer
A buffer that can be used to store bytes for an output stream of the connection. |
protected InetSocketAddress |
_remoteAddress
The remote connection address. |
| Constructor Summary | |
|---|---|
NetConnection()
|
|
| Method Summary | |
|---|---|
Decoder<ByteBuffer,Object> |
getDecoder()
|
Encoder<Object,ByteBuffer> |
getEncoder()
Getter for Encoder. |
InetSocketAddress |
getLocalAddress()
|
InetSocketAddress |
getRemoteAddress()
|
abstract NetConnectionStatistics |
getStatistics()
Returns general connection statistics about this connection. |
boolean |
hasDecoder()
Returns true if a valid decoder has been set for this connection. |
boolean |
hasEncoder()
Returns true if a valid encoder has been set for this connection. |
NetConnection |
setDecoder(Decoder<ByteBuffer,Object> decoder)
Sets the decoder that should be used by this connection to decoder incoming messages. |
NetConnection |
setEncoder(Encoder<Object,ByteBuffer> encoder)
Sets the encoder that should be used by this connection to encode outgoing messages. |
NetConnection |
setInputBufferSize(int size)
Builder option to adjust the buffer size of output buffer. |
NetConnection |
setOutputBufferSize(int size)
Builder option to adjust the buffer size of output buffer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.kuka.comm.Connection |
|---|
connect, isConnected, isConnectionless, send |
| Field Detail |
|---|
protected byte[] _inputBuffer
protected byte[] _outputBuffer
protected InetSocketAddress _localAddress
protected InetSocketAddress _remoteAddress
| Constructor Detail |
|---|
public NetConnection()
| Method Detail |
|---|
public InetSocketAddress getLocalAddress()
InetSocketAddress of local connection endpointpublic InetSocketAddress getRemoteAddress()
InetSocketAddress of remote connection endpointpublic final NetConnection setEncoder(Encoder<Object,ByteBuffer> encoder)
encoder - the encoder for outgoing messages
public final NetConnection setDecoder(Decoder<ByteBuffer,Object> decoder)
decoder - the decoder for incoming messages
public final Encoder<Object,ByteBuffer> getEncoder()
Encoder.
Encoder.public final Decoder<ByteBuffer,Object> getDecoder()
Decoder.public final boolean hasEncoder()
Connectiontrue if a valid encoder has been set for this connection.
true if connection has an encoder, false otherwise.public final boolean hasDecoder()
Connectiontrue if a valid decoder has been set for this connection.
true if connection has a decoder, false otherwise.public final NetConnection setInputBufferSize(int size)
There is no upper limit to ensure an optimal network bandwidth use. This optimal bufferSize has to be calculated by the application which uses this framework. A common formula is RoundTripTime * bandwidth. To retrieve these values use to ConnectionStatsProvider.
size - An integer stating the new size for the buffer.
public final NetConnection setOutputBufferSize(int size)
There is no upper limit to ensure an optimal network bandwidth use. This optimal bufferSize has to be calculated by the application which uses this framework. A common formula is RoundTripTime * bandwidth. To retrieve these values use to ConnectionStatsProvider.
size - An integer stating the new size for the buffer.
public abstract NetConnectionStatistics getStatistics()
Connection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||