Encapsulates a connection, providing read/write locking for synchronisation. Additionally, this should provide a useful position for adding reconnection abilities.
Declaring type: Connection
Namespace: Zyan.Communication.Protocols.Tcp.DuplexChannel
Assembly: Zyan.Communication
Collapse/Expand Public Fields (see also: Protected Fields)
  Name Description
Public Field Static BufferSize Defines the buffer size (Default = 10K).
Collapse/Expand Protected Fields
  Name Description
Protected Field _channel Parent Remoting channel of this connection.
Protected Field _connectionRole Defines the connection role.
Protected Field _maxRetries Maximum number of connection retry attempts.
Protected Field _reader Reader for reading binary raw data from network stream.
Protected Field _remoteChannelData Configuration data of the remoting channel.
Protected Field _retryDelay Delay after retry attempt in milliseconds.
Protected Field _socket Socket used for TCP communication.
Protected Field _socketRemoteAddress Address of the remote socket endpoint.
Protected Field _socketRemotePort Port of the remote socket endpoint.
Protected Field _stream Networkstream for sending and receiving raw data.
Protected Field _writer Writer for writing binary raw data to network stream.
Collapse/Expand Protected Constructors
  Name Description
Protected Method Connection Overloaded. Creates a new instance of the Connection class.
Collapse/Expand Public Methods
  Name Description
Public Method Close Closes the connection.
Public Method Static CreateConnection Creates a connection object.
Public Method Static GetConnection Gets a specified connection.
Public Method LockRead Locks the connection for reading through other threads.
Public Method LockWrite Locks the connection for writing through other threads.
Public Method ReleaseRead Releases the read lock.
Public Method ReleaseWrite Releases the write lock.
Collapse/Expand Public Properties
  Name Description
Public Property IsClosed Returns if the connection is already closed or not.
Public Property IsLocalHost Checks, if the connection is a local connection or not.
Public Property LocalAddress Gets the address of the local channel.
Public Property LocalChannelID Gets the unique identifier of the local channel.
Public Property MaxRetries Gets or sets the maximum number of connection retry attempts.
Public Property Reader Gets a binary reader for reading raw data from the network stream.
Public Property RemoteAddresses Gets a list of all registered addresses of the remote channel.
Public Property RemoteChannelID Gets the unique identifier of the remote channel.
Public Property RetryDelay Gets or sets the delay after a retry attempt in milliseconds.
Public Property Socket Gets the underlying socket of the connection.
Public Property Stream Gets the Network stream.
Public Property TcpKeepAliveEnabled Enables or disables TCP KeepAlive.
Public Property TcpKeepAliveInterval Gets or sets the TCP KeepAlive interval in milliseconds
Public Property TcpKeepAliveTime Gets or sets the TCP KeepAlive time in milliseconds.
Public Property Writer Gets a binary writer for writing raw data from the network stream.