IpTcpClientChannel Class

From RemObjects Wiki
Jump to: navigation, search

This is a Library topic for RemObjects SDK for .NET
This page is generated from external data, please do not update

NamespacesInterfacesClassesEnumsImplements

Contents

Overview

The IpTcpClientChannel class inherits from ClientChannel to provide client communication via raw TCP connections based on Internet Pack's TcpClient.


Location

Implemented interfaces


Constants

URL_SCHEMES_NOT_SUPPORTED   protected     (declared in ClientChannel)



Oxygene:   const URL_SCHEMES_NOT_SUPPORTED: String
C#:   const String URL_SCHEMES_NOT_SUPPORTED
VB:   Dim URL_SCHEMES_NOT_SUPPORTED As String


Properties

Busy     (declared in ClientChannel)

Busy is true if the transport channel is currently busy with an operation. Otherwise Busy is false. By default, if the transport channel is busy, it will not attempt to process another request and a ChannelBusyException exception is raised if you try to do so.



Prism:   property Busy: Boolean read
C#:   Boolean Busy { get; }
VB:   Property ReadOnly Busy As Boolean


HasAfterReceiveStream   protected     (declared in Channel)



Prism:   property HasAfterReceiveStream: Boolean read
C#:   Boolean HasAfterReceiveStream { get; }
VB:   Property ReadOnly HasAfterReceiveStream As Boolean


HasBeforeSendStream   protected     (declared in Channel)



Prism:   property HasBeforeSendStream: Boolean read
C#:   Boolean HasBeforeSendStream { get; }
VB:   Property ReadOnly HasBeforeSendStream As Boolean


HasOnTransferProgress   protected     (declared in ClientChannel)



Prism:   property HasOnTransferProgress: Boolean read
C#:   Boolean HasOnTransferProgress { get; }
VB:   Property ReadOnly HasOnTransferProgress As Boolean


Hostname

The host name or IP address of the server.



Prism:   property Hostname: String read write
C#:   String Hostname { get; set; }
VB:   Property Hostname As String


KeepAlive

Controls whether to use HTTP Keep-Alive to keep the connection alive between requests.
If enabled (true) , once a request is made and a connection is established, this connection is kept open and used for future requests.
If disabled, the connection is closed, and a new connection is created for future requests.
Since establishing a connection is - relatively speaking - a costly and resource intensive operation for the network, compared to sending small amounts of data, it is recommended to keep this option enabled for optimal performance, if requests to the server are done relatively frequently.
For Keep-Alive to work, the option must be supported and enabled on both client and server.



Prism:   property KeepAlive: Boolean read write
C#:   Boolean KeepAlive { get; set; }
VB:   Property KeepAlive As Boolean


Port

The port number of the server. The default port for the RemObjects SDK TCP Servers is port 8090.



Prism:   property Port: Int32 read write
C#:   Int32 Port { get; set; }
VB:   Property Port As Int32


TargetUri



Prism:   property TargetUri: Uri read write
C#:   Uri TargetUri { get; set; }
VB:   Property TargetUri As Uri


TargetUrl     (declared in ClientChannel)



Prism:   property TargetUrl: String read write
C#:   String TargetUrl { get; set; }
VB:   Property TargetUrl As String


TcpClient

Provides access to the underlying Internet Pack TcpClient component that will be used for the communication with the server.



Prism:   property TcpClient: TcpClient read
C#:   TcpClient TcpClient { get; }
VB:   Property ReadOnly TcpClient As TcpClient


Timeout

Specified the timeout, in seconds, after which the client channel will abort the request. This ensures that for unresponsive servers, the client will not hang indefinitely waiting for a reply.

The Default value is 60 (seconds, i.e. 1 minute).



Prism:   property Timeout: Int32 read write
C#:   Int32 Timeout { get; set; }
VB:   Property Timeout As Int32


TimeoutEnabled

Specifies whether the client channel will timeout waiting for a request if no data is received over the connection for the amount of time specified in the Timeout property.



Prism:   property TimeoutEnabled: Boolean read write
C#:   Boolean TimeoutEnabled { get; set; }
VB:   Property TimeoutEnabled As Boolean


Class Methods

BuildTargetUri   protected     (declared in ClientChannel)



Oxygene:   class method BuildTargetUri(protocol: String; host: String; port: Int32; message: String): Uri
C#:   static Uri BuildTargetUri(String protocol, String host, Int32 port, String message)
VB:   Shared Function BuildTargetUri(protocol As String, host As String, port As Int32, message As String) As Uri


Parameters:

  • protocol:
  • host:
  • port:
  • message:


ChannelMatchingTargetUri (String): IClientChannel     (declared in ClientChannel)



Oxygene:   class method ChannelMatchingTargetUri(url: String): IClientChannel
C#:   static IClientChannel ChannelMatchingTargetUri(String url)
VB:   Shared Function ChannelMatchingTargetUri(url As String) As IClientChannel


Parameters:

  • url:


ChannelMatchingTargetUri (Uri): IClientChannel     (declared in ClientChannel)



Oxygene:   class method ChannelMatchingTargetUri(uri: Uri): IClientChannel
C#:   static IClientChannel ChannelMatchingTargetUri(Uri uri)
VB:   Shared Function ChannelMatchingTargetUri(uri As Uri) As IClientChannel


Parameters:

  • uri:


Instance Methods

constructor



Oxygene:   constructor
C#:   constructor()
VB:   Sub New


AsyncDispatch     (declared in ClientChannel)



Oxygene:   method AsyncDispatch(message: IMessage; callback: AsyncCallback; userData: Object): IClientAsyncResult
C#:   IClientAsyncResult AsyncDispatch(IMessage message, AsyncCallback callback, Object userData)
VB:   Function AsyncDispatch(message As IMessage, callback As AsyncCallback, userData As Object) As IClientAsyncResult


Parameters:

  • message:
  • callback:
  • userData:


BeforeDispatch   protected     (declared in ClientChannel)



Oxygene:   method BeforeDispatch(message: IMessage)
C#:   void BeforeDispatch(IMessage message)
VB:   Sub BeforeDispatch(message As IMessage)


Parameters:

  • message:


BeginDispatch (IMessage, AsyncCallback, Boolean, Object): IClientAsyncResult   protected     (declared in ClientChannel)



Oxygene:   method BeginDispatch(message: IMessage; callback: AsyncCallback; disposeChannel: Boolean; userData: Object): IClientAsyncResult
C#:   IClientAsyncResult BeginDispatch(IMessage message, AsyncCallback callback, Boolean disposeChannel, Object userData)
VB:   Function BeginDispatch(message As IMessage, callback As AsyncCallback, disposeChannel As Boolean, userData As Object) As IClientAsyncResult


Parameters:

  • message:
  • callback:
  • disposeChannel:
  • userData:


BeginDispatch (IMessage, AsyncCallback, Object): IClientAsyncResult     (declared in ClientChannel)



Oxygene:   method BeginDispatch(message: IMessage; callback: AsyncCallback; userData: Object): IClientAsyncResult
C#:   IClientAsyncResult BeginDispatch(IMessage message, AsyncCallback callback, Object userData)
VB:   Function BeginDispatch(message As IMessage, callback As AsyncCallback, userData As Object) As IClientAsyncResult


Parameters:

  • message:
  • callback:
  • userData:


CheckChannelBusy   protected     (declared in ClientChannel)



Oxygene:   method CheckChannelBusy
C#:   void CheckChannelBusy()
VB:   Sub CheckChannelBusy


Clone



Oxygene:   method Clone: Object
C#:   Object Clone()
VB:   Function Clone As Object


CopyProperties (Channel)   protected     (declared in Channel)



Oxygene:   method CopyProperties(source: Channel)
C#:   void CopyProperties(Channel source)
VB:   Sub CopyProperties(source As Channel)


Parameters:

  • source:


CopyProperties (ClientChannel)   protected



Oxygene:   method CopyProperties(source: ClientChannel)
C#:   void CopyProperties(ClientChannel source)
VB:   Sub CopyProperties(source As ClientChannel)


Parameters:

  • source:


Dispatch     (declared in ClientChannel)

The implementation of IClientChannel.Dispatch. This method ensures the transport is not busy before calling IntDispatch and passing the given IMessage. If the transport is busy, a ChannelBusyException is thrown.


Oxygene:   method Dispatch(message: IMessage)
C#:   void Dispatch(IMessage message)
VB:   Sub Dispatch(message As IMessage)


Parameters:

  • message:


Dispose   protected



Oxygene:   method Dispose(disposing: Boolean)
C#:   void Dispose(Boolean disposing)
VB:   Sub Dispose(disposing As Boolean)


Parameters:

  • disposing:


EndDispatch     (declared in ClientChannel)



Oxygene:   method EndDispatch(ar: IAsyncResult): IMessage
C#:   IMessage EndDispatch(IAsyncResult ar)
VB:   Function EndDispatch(ar As IAsyncResult) As IMessage


Parameters:

  • ar:


HookUpConnectionEvents   protected     (declared in IpClientChannel)

If the HasOnTransferEvents property returns true (which means that the OnTransferProgress event handler is defined), this method assigns the OnBytesSend and OnBytesReceived event handlers to the corresponding events of the provided Connection.

This method adds events routing from the underlying Connection to this ClientChannel instance. It is called when a concrete implementation of the ClientChannel performs network operations like dispatching a request to the server.


Oxygene:   method HookUpConnectionEvents(connection: Connection)
C#:   void HookUpConnectionEvents(Connection connection)
VB:   Sub HookUpConnectionEvents(connection As Connection)


Parameters:

  • connection:


IntDispatch   protected



Oxygene:   method IntDispatch(request: Stream; response: IMessage)
C#:   void IntDispatch(Stream request, IMessage response)
VB:   Sub IntDispatch(request As Stream, response As IMessage)


Parameters:

  • request:
  • response:


OnBytesReceived   protected     (declared in IpClientChannel)

This method acts as event handler for the Connection actually performing the network operations. It is added and removed via HookUpConnectionEvents and UnhookConnectionEvents.

This method routes the received event by calling the TriggerOnTransferProgress method, which raises the OnTransferProgress event of the ClientChannel class.


Oxygene:   method OnBytesReceived(e: EventArgs; sender: Object)
C#:   void OnBytesReceived(EventArgs e, Object sender)
VB:   Sub OnBytesReceived(e As EventArgs, sender As Object)


Parameters:

  • e:
  • sender:


OnBytesSent   protected     (declared in IpClientChannel)

This method acts as event handler for the Connection actually performing the network operations. It is added and removed via HookUpConnectionEvents and UnhookConnectionEvents.

This method routes the received event by calling the TriggerOnTransferProgress method, which raises the OnTransferProgress event of the ClientChannel class.


Oxygene:   method OnBytesSent(e: EventArgs; sender: Object)
C#:   void OnBytesSent(EventArgs e, Object sender)
VB:   Sub OnBytesSent(e As EventArgs, sender As Object)


Parameters:

  • e:
  • sender:


TriggerAfterReceiveStream   protected     (declared in Channel)



Oxygene:   method TriggerAfterReceiveStream(var stream: Stream)
C#:   void TriggerAfterReceiveStream(ref Stream stream)
VB:   Sub TriggerAfterReceiveStream(ByRef stream As Stream)


Parameters:

  • stream:


TriggerBeforeSendStream   protected     (declared in Channel)



Oxygene:   method TriggerBeforeSendStream(var stream: Stream)
C#:   void TriggerBeforeSendStream(ref Stream stream)
VB:   Sub TriggerBeforeSendStream(ByRef stream As Stream)


Parameters:

  • stream:


TriggerOnException   protected     (declared in ClientChannel)



Oxygene:   method TriggerOnException(exception: Exception; out handled: Boolean)
C#:   void TriggerOnException(Exception exception, out Boolean handled)
VB:   Sub TriggerOnException(exception As Exception, <OutAttribute> ByRef handled As Boolean)


Parameters:

  • exception:
  • handled:


TriggerOnLoginNeeded   protected     (declared in ClientChannel)



Oxygene:   method TriggerOnLoginNeeded(exception: Exception; out loginSuccessful: Boolean)
C#:   void TriggerOnLoginNeeded(Exception exception, out Boolean loginSuccessful)
VB:   Sub TriggerOnLoginNeeded(exception As Exception, <OutAttribute> ByRef loginSuccessful As Boolean)


Parameters:

  • exception:
  • loginSuccessful:


TriggerOnTransferEnd   protected     (declared in ClientChannel)



Oxygene:   method TriggerOnTransferEnd(direction: TransferDirection)
C#:   void TriggerOnTransferEnd(TransferDirection direction)
VB:   Sub TriggerOnTransferEnd(direction As TransferDirection)


Parameters:

  • direction:


TriggerOnTransferProgress   protected     (declared in ClientChannel)



Oxygene:   method TriggerOnTransferProgress(direction: TransferDirection; current: Int64)
C#:   void TriggerOnTransferProgress(TransferDirection direction, Int64 current)
VB:   Sub TriggerOnTransferProgress(direction As TransferDirection, current As Int64)


Parameters:

  • direction:
  • current:


TriggerOnTransferStart   protected     (declared in ClientChannel)



Oxygene:   method TriggerOnTransferStart(direction: TransferDirection; total: Int64)
C#:   void TriggerOnTransferStart(TransferDirection direction, Int64 total)
VB:   Sub TriggerOnTransferStart(direction As TransferDirection, total As Int64)


Parameters:

  • direction:
  • total:


UnhookConnectionEvents   protected     (declared in IpClientChannel)

Removes event handlers previously added via the HookUpConnectionEvents method.


Oxygene:   method UnhookConnectionEvents(connection: Connection)
C#:   void UnhookConnectionEvents(Connection connection)
VB:   Sub UnhookConnectionEvents(connection As Connection)


Parameters:

  • connection:


Events

AfterReceiveStream     (declared in Channel)

This event is triggered by client and server channels directly after a request or response stream has been received and before the stream gets parsed into a message. User code can assign handlers to this event to process, inspect or modify incoming messages, before they get handled by the RemObjects SDK framework. The passed Stream is a MemoryStream and may be modified.

If no handlers are assigned to the AfterReceiveStream event, the message will load the data directly from the incoming medium (usually the network stream); assigning event handlers to AfterReceiveStream will induce a slight overhead as the data will first be copied into a local memory buffer for the event handler. This should not have any noticeably effect except for very large messages or on resource-limited systems such as Compact Framework Clients, but if utmost performance is important, take this note into consideration.



Oxygene:   event AfterReceiveStream: StreamEventHandler
delegate: method Invoke(sender: Object; e: StreamEventArgs)

C#:   event StreamEventHandler AfterReceiveStream
delegate: void Invoke(Object sender, StreamEventArgs e)

VB:   Event AfterReceiveStream As StreamEventHandler
delegate: Sub Invoke(sender As Object, e As StreamEventArgs)


BeforeSendStream     (declared in Channel)

This event is triggered by client and server channels directly before a request or response stream will be sent over the network. User code can assign handlers to this event to process, inspect or modify incoming messages before they get sent out to the remote system.

The passed Stream is a MemoryStream and may be modified.



Oxygene:   event BeforeSendStream: StreamEventHandler
delegate: method Invoke(sender: Object; e: StreamEventArgs)

C#:   event StreamEventHandler BeforeSendStream
delegate: void Invoke(Object sender, StreamEventArgs e)

VB:   Event BeforeSendStream As StreamEventHandler
delegate: Sub Invoke(sender As Object, e As StreamEventArgs)


OnException     (declared in ClientChannel)

This event is raised if an exception occurs during the execution of a remote request through the channel. The event will be raised both for exceptions originating from the server and for exceptions during communication (such as unavailability of the server). Attach a handler to this event to do custom handling of events without having to reply on explicit try/catch blocks in the calling code.


This event will not be raised for SessionNotFoundExceptions. These will be handled separately by the OnLoginNeeded event.



Oxygene:   event OnException: RequestExceptionEventHandler
delegate: method Invoke(sender: Object; e: RequestExceptionEventArgs)

C#:   event RequestExceptionEventHandler OnException
delegate: void Invoke(Object sender, RequestExceptionEventArgs e)

VB:   Event OnException As RequestExceptionEventHandler
delegate: Sub Invoke(sender As Object, e As RequestExceptionEventArgs)


OnLoginNeeded     (declared in ClientChannel)

This event is raised if an SessionNotFoundException occurs during the execution of a remote request through the channel. The event gives you the opportunity to perform a login on the server (for example by calling a custom Login method, and then retry the call by setting the EventArgs' LoginSuccessful property to true. This way, your client can recover from a timed-out session to automatically logging in again, without the calling code having to consider the handling of SessionNotFoundExceptions manually.



Oxygene:   event OnLoginNeeded: LoginNeededEventHandler
delegate: method Invoke(sender: Object; e: LoginNeededEventArgs)

C#:   event LoginNeededEventHandler OnLoginNeeded
delegate: void Invoke(Object sender, LoginNeededEventArgs e)

VB:   Event OnLoginNeeded As LoginNeededEventHandler
delegate: Sub Invoke(sender As Object, e As LoginNeededEventArgs)


OnTransferEnd     (declared in ClientChannel)

This event is triggered by the client channel after a transfer is completed (either the sending of a request or the receiving of a response).



Oxygene:   event OnTransferEnd: TransferEndEventHandler
delegate: method Invoke(sender: Object; e: TransferEndEventArgs)

C#:   event TransferEndEventHandler OnTransferEnd
delegate: void Invoke(Object sender, TransferEndEventArgs e)

VB:   Event OnTransferEnd As TransferEndEventHandler
delegate: Sub Invoke(sender As Object, e As TransferEndEventArgs)


OnTransferProgress     (declared in ClientChannel)

This event is triggered by the client channel during a transfer (either the sending of a request or the receiving of a response) whenever a new block of data has been sent or received.



Oxygene:   event OnTransferProgress: TransferProgressEventHandler
delegate: method Invoke(sender: Object; e: TransferProgressEventArgs)

C#:   event TransferProgressEventHandler OnTransferProgress
delegate: void Invoke(Object sender, TransferProgressEventArgs e)

VB:   Event OnTransferProgress As TransferProgressEventHandler
delegate: Sub Invoke(sender As Object, e As TransferProgressEventArgs)


OnTransferStart     (declared in ClientChannel)

This event is triggered by the client channel when a transfer (either the sending of a request or the receiving of a response) is about to be started.



Oxygene:   event OnTransferStart: TransferStartEventHandler
delegate: method Invoke(sender: Object; e: TransferStartEventArgs)

C#:   event TransferStartEventHandler OnTransferStart
delegate: void Invoke(Object sender, TransferStartEventArgs e)

VB:   Event OnTransferStart As TransferStartEventHandler
delegate: Sub Invoke(sender As Object, e As TransferStartEventArgs)


See Also


Product: RemObjects SDK
Available Editions: RemObjects SDK for .NET, Xcode, Delphi, Java and JavaScript

GlossaryArticlesLibrarySamples

Personal tools
Namespaces

Variants
Actions
Navigation
products
platforms
special
Toolbox