AMPS C# Client  5.3.5.0
AMPS C# Client for .NET
AMPS.Client.Transport Interface Reference

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...

Public Member Functions

void connect (Uri uri)
 Connect to an AMPS server. More...
 
void close ()
 Closes the connection. More...
 
void disconnect ()
 Disconnects from the AMPS server. More...
 
void setMessageHandler (MessageHandler ml)
 Sets the message handler for processing incoming messages. More...
 
void setDisconnectHandler (TransportDisconnectHandler dh)
 Sets the disconnect handler for handling disconnection events. More...
 
void setExceptionListener (TCPTransportImpl.ExceptionListener exceptionListener)
 Sets the exception listener for handling exceptions. More...
 
void setThreadCreatedHandler (ThreadCreatedHandler handler)
 Sets the handler for thread creation events. More...
 
void send (Message message)
 Sends a message to the AMPS server. More...
 
void setReadTimeout (int readTimeoutMillis_)
 Sets the read timeout in milliseconds. More...
 
void sendWithoutRetry (Message message)
 Sends a message to the AMPS server without retrying on failure. More...
 
Message allocateMessage ()
 Allocates a new message. More...
 
long writeQueueSize ()
 Returns the size of the write queue. More...
 
long readQueueSize ()
 Returns the size of the read queue. More...
 
long flush ()
 Flushes the transport. More...
 
long flush (long timeout)
 Flushes the transport with a specified timeout. More...
 
void handleCloseEvent (int failedVersion, String message, Exception exception)
 Handles the close event with the specified parameters. More...
 
int getVersion ()
 Returns the version of the transport. More...
 
void setTransportFilter (TransportFilter filter_)
 Sets a TransportFilter that filters raw bytes before send and after receive. More...
 
void setTransportFilter (TransportFilterModifiable filter_)
 Sets a TransportFilterModifiable that filters and possibly modifies raw bytes before send and after receive. More...
 
Action getIdleAction ()
 Gets the action to be performed during idle periods. More...
 
void setIdleAction (Action runnable)
 
void 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. More...
 

Detailed Description

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.

Member Function Documentation

◆ allocateMessage()

Message AMPS.Client.Transport.allocateMessage ( )

Allocates a new message.

Returns
The allocated message.

◆ close()

void AMPS.Client.Transport.close ( )

Closes the connection.

◆ connect()

void AMPS.Client.Transport.connect ( Uri  uri)

Connect to an AMPS server.

Parameters
uriSpecifies the protocol and address of the server.
Exceptions
ConnectionRefusedExceptionThrown when the connection is refused.
AlreadyConnectedExceptionThrown 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
DisconnectedExceptionThrown when disconnected.

◆ flush() [2/2]

long AMPS.Client.Transport.flush ( long  timeout)

Flushes the transport with a specified timeout.

Parameters
timeoutThe timeout value in milliseconds.
Returns
The number of bytes flushed.
Exceptions
DisconnectedExceptionThrown 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
failedVersionThe failed version.
messageThe message.
exceptionThe 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
clientA 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
DisconnectedExceptionThrown when disconnected.

◆ send()

void AMPS.Client.Transport.send ( Message  message)

Sends a message to the AMPS server.

Parameters
messageThe message to send.
Exceptions
DisconnectedExceptionThrown when disconnected.

◆ sendWithoutRetry()

void AMPS.Client.Transport.sendWithoutRetry ( Message  message)

Sends a message to the AMPS server without retrying on failure.

Parameters
messageThe message to send.

◆ setDisconnectHandler()

void AMPS.Client.Transport.setDisconnectHandler ( TransportDisconnectHandler  dh)

Sets the disconnect handler for handling disconnection events.

Parameters
dhThe disconnect handler.

◆ setExceptionListener()

void AMPS.Client.Transport.setExceptionListener ( TCPTransportImpl.ExceptionListener  exceptionListener)

Sets the exception listener for handling exceptions.

Parameters
exceptionListenerThe exception listener.

◆ setIdleAction()

void AMPS.Client.Transport.setIdleAction ( Action  runnable)

Sets a AMPSRunnable that is invoked during idle-time processing for this connection.

Parameters
runnableA AMPSRunnable instance whose run() method is invoked.

◆ setMessageHandler()

void AMPS.Client.Transport.setMessageHandler ( MessageHandler  ml)

Sets the message handler for processing incoming messages.

Parameters
mlThe message handler.

◆ setReadTimeout()

void AMPS.Client.Transport.setReadTimeout ( int  readTimeoutMillis_)

Sets the read timeout in milliseconds.

Parameters
readTimeoutMillis_The read timeout in milliseconds.

◆ setThreadCreatedHandler()

void AMPS.Client.Transport.setThreadCreatedHandler ( ThreadCreatedHandler  handler)

Sets the handler for thread creation events.

Parameters
handlerThe thread created handler.

◆ setTransportFilter() [1/2]

void AMPS.Client.Transport.setTransportFilter ( TransportFilter  filter_)

Sets a TransportFilter that filters raw bytes before send and after receive.

Parameters
filter_A TransportFilter such as AMPS.Client.TransportTraceFilter.

◆ setTransportFilter() [2/2]

void AMPS.Client.Transport.setTransportFilter ( TransportFilterModifiable  filter_)

Sets a TransportFilterModifiable that filters and possibly modifies raw bytes before send and after receive.

Parameters
filter_A TransportFilterModifiable.

◆ writeQueueSize()

long AMPS.Client.Transport.writeQueueSize ( )

Returns the size of the write queue.

Returns
The size of the write queue.
Exceptions
DisconnectedExceptionThrown when disconnected.

The documentation for this interface was generated from the following file: