Interface that is used to manage and configure connections to AMPS. Typically a transport is created and used internally by Client instance. There is usually no reason to make direct use of it. Its functionality is best accessed via the client instance.
More...
Interface that is used to manage and configure connections to AMPS. Typically a transport is created and used internally by Client instance. There is usually no reason to make direct use of it. Its functionality is best accessed via the client instance.
◆ allocateMessage()
Message AMPS.Client.Transport.allocateMessage |
( |
| ) |
|
Allocates a new message.
- Returns
- The allocated message.
◆ close()
void AMPS.Client.Transport.close |
( |
| ) |
|
◆ connect()
void AMPS.Client.Transport.connect |
( |
Uri |
uri | ) |
|
Connect to an AMPS server.
- Parameters
-
uri | Specifies the protocol and address of the server. |
- Exceptions
-
ConnectionRefusedException | Thrown when the connection is refused. |
AlreadyConnectedException | Thrown when already connected. |
◆ disconnect()
void AMPS.Client.Transport.disconnect |
( |
| ) |
|
Disconnects from the AMPS server.
◆ flush() [1/2]
long AMPS.Client.Transport.flush |
( |
| ) |
|
Flushes the transport.
- Returns
- The number of bytes flushed.
- Exceptions
-
DisconnectedException | Thrown when disconnected. |
◆ flush() [2/2]
long AMPS.Client.Transport.flush |
( |
long |
timeout | ) |
|
Flushes the transport with a specified timeout.
- Parameters
-
timeout | The timeout value in milliseconds. |
- Returns
- The number of bytes flushed.
- Exceptions
-
DisconnectedException | Thrown when disconnected. |
◆ getIdleAction()
Action AMPS.Client.Transport.getIdleAction |
( |
| ) |
|
Gets the action to be performed during idle periods.
- Returns
- The action to be performed during idle periods.
◆ getVersion()
int AMPS.Client.Transport.getVersion |
( |
| ) |
|
Returns the version of the transport.
- Returns
- The version of the transport.
◆ handleCloseEvent()
void AMPS.Client.Transport.handleCloseEvent |
( |
int |
failedVersion, |
|
|
String |
message, |
|
|
Exception |
exception |
|
) |
| |
Handles the close event with the specified parameters.
- Parameters
-
failedVersion | The failed version. |
message | The message. |
exception | The exception. |
◆ initFromClient()
void AMPS.Client.Transport.initFromClient |
( |
Client |
client | ) |
|
Called by Client before calling connect to give Transport access to any information in the Client needed by the Transport, such as message handler, exception listener, etc.
- Parameters
-
client | A Client to initialize from. |
◆ readQueueSize()
long AMPS.Client.Transport.readQueueSize |
( |
| ) |
|
Returns the size of the read queue.
- Returns
- The size of the read queue.
- Exceptions
-
DisconnectedException | Thrown when disconnected. |
◆ send()
void AMPS.Client.Transport.send |
( |
Message |
message | ) |
|
Sends a message to the AMPS server.
- Parameters
-
message | The message to send. |
- Exceptions
-
DisconnectedException | Thrown when disconnected. |
◆ sendWithoutRetry()
void AMPS.Client.Transport.sendWithoutRetry |
( |
Message |
message | ) |
|
Sends a message to the AMPS server without retrying on failure.
- Parameters
-
message | The message to send. |
◆ setDisconnectHandler()
Sets the disconnect handler for handling disconnection events.
- Parameters
-
dh | The disconnect handler. |
◆ setExceptionListener()
void AMPS.Client.Transport.setExceptionListener |
( |
TCPTransportImpl.ExceptionListener |
exceptionListener | ) |
|
Sets the exception listener for handling exceptions.
- Parameters
-
exceptionListener | The exception listener. |
◆ setIdleAction()
void AMPS.Client.Transport.setIdleAction |
( |
Action |
runnable | ) |
|
Sets a AMPSRunnable that is invoked during idle-time processing for this connection.
- Parameters
-
runnable | A AMPSRunnable instance whose run() method is invoked. |
◆ setMessageHandler()
Sets the message handler for processing incoming messages.
- Parameters
-
◆ setReadTimeout()
void AMPS.Client.Transport.setReadTimeout |
( |
int |
readTimeoutMillis_ | ) |
|
Sets the read timeout in milliseconds.
- Parameters
-
readTimeoutMillis_ | The read timeout in milliseconds. |
◆ setThreadCreatedHandler()
Sets the handler for thread creation events.
- Parameters
-
handler | The thread created handler. |
◆ setTransportFilter() [1/2]
Sets a TransportFilter that filters raw bytes before send and after receive.
- Parameters
-
◆ setTransportFilter() [2/2]
◆ writeQueueSize()
long AMPS.Client.Transport.writeQueueSize |
( |
| ) |
|
Returns the size of the write queue.
- Returns
- The size of the write queue.
- Exceptions
-
DisconnectedException | Thrown when disconnected. |
The documentation for this interface was generated from the following file: