OpenClient
Herda de: Disposable
Construtores
OpenClient(string, uint)
Creates an instance of OpenClient which is not connected yet
- host
- The host name of API endpoint
- port
- The host port number
Propriedades
IsCompleted : bool
If client stream is completed without any error then it will return True, otherwise False
IsTerminated : bool
If there was any error (exception) on client stream then this will return True, otherwise False
Métodos
DisposeManaged()
Disposes the client, releases all used resources, and stops all running operations
GetLength(byte[]) : int
Returns the length of a received message without causing extra allocation
- lengthBytes
- The byte array of received length data
Retorna: int
OnCompleted()
Completes each observer by calling their OnCompleted method
OnError(Exception)
Disposes the client and then calls each observer OnError after an exception thrown
- exception
- Exception
ReadTcp(CancellationToken) : Task
This method will read the TCP stream for incoming messages
- cancellationToken
- The cancellation token that will be used on ReadAsync calls
Retorna: Task
SendMessage(ProtoMessage, CancellationToken) : Task
This method will insert your message on messages queue, it will not send the message instantly
- message
- Message
- cancellationToken
Retorna: Task
SendMessage``1(T, ProtoOAPayloadType, string, CancellationToken)
This method will insert your message on messages queue, it will not send the message instantly
- message
- Message
- payloadType
- Message Payload Type (ProtoOAPayloadType)
- clientMsgId
- The client message ID (optional)
- cancellationToken
Retorna: Task
SendMessage``1(T, string, CancellationToken)
This method will insert your message on messages queue, it will not send the message instantly By using this overload of SendMessage method you avoid passing the message payload type and it gets the payload from message itself
- message
- Message
- clientMsgId
- The client message ID (optional)
- cancellationToken
Retorna: Task
SendMessage``1(T, ProtoPayloadType, string, CancellationToken)
This method will insert your message on messages queue, it will not send the message instantly
- message
- Message
- payloadType
- Message Payload Type (ProtoPayloadType)
- clientMsgId
- The client message ID (optional)
- cancellationToken
Retorna: Task
ThrowObjectDisposedExceptionIfDisposed()
Throws ObjectDisposedException if the client was disposed
WriteTcp(byte[], CancellationToken) : Task
Writes the message bytes to TCP stream
- messageByte
- cancellationToken
- The cancellation token that will be used on calling stream methods
Retorna: Task
Eventos
MessageReceived : Action<ProtoMessage>
This event will be triggered when a message is received from the API