Click or drag to resize
IConnector Interface
The interface for objects that can establish a connection with a remote machine.

Namespace: VirtualRadar.Interface.Network
Assembly: VirtualRadar.Interface (in VirtualRadar.Interface.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public interface IConnector : IBackgroundThreadExceptionCatcher, 
	IDisposable

The IConnector type exposes the following members.

Properties
  NameDescription
Public propertyAuthentication
Gets or sets the authentication to use with the connection. If this is set then the other side must implement the same authentication.
Public propertyConnection
Gets the first (or only) connection established by the connector.
Public propertyConnectionStatus
Gets the connection status. This only reflects the status of the connector - individual connections being maintained by the connector have their own status.
Public propertyCountExceptions
Gets the number of exceptions ever encountered by the connector.
Public propertyCreated
Gets the date and time, at UTC, that the connector was first created.
Public propertyEstablishingConnections
Public propertyHasConnection
Gets a value indicating that the connector has established a connection with at least one end point.
Public propertyIntent
Gets a description of the intended use of the connector. Only used for diagnostics.
Public propertyIsPassive
Gets or sets a value indicating whether the connector waits for other things to connect to it or it actively connects to other things.
Public propertyIsSingleConnection
Gets or sets a value indicating whether the connector supports multiple connections or a single connection.
Public propertyLastException
Gets the last exception encountered by the connector.
Public propertyName
Gets or sets the name of the connector.
Public propertyStaleMessageTimeout
Gets the maximum age (in milliseconds) that a message can sit in the transmit queue before it is considered stale and discarded.
Top
Methods
  NameDescription
Public methodCloseConnection
Tells the connector to close all connections. This blocks until all connections have been shut down.
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from IDisposable.)
Public methodEstablishConnection
Tells the connector to establish a connection. This is a non-blocking call, the function will return immediately and establish the connection in the background.
Public methodGetActivityHistory
Returns an array of the last so-many activities performed by the connector or any of its connections. Exactly how many is undefined. This always returns the most recent set of activities.
Public methodGetConnections
Returns an array of established connections made by the connector.
Public methodGetExceptionHistory
Returns an array of the last so-many exceptions encountered by the connector. Exactly how many is undefined, but it can be more than one and will never exceed CountExceptions. Always returns the most recent set of exceptions.
Public methodGetFirstConnection
Returns the first established connection or null if there are no connections.
Public methodRead(Byte, ConnectionReadDelegate)
Reads the next chunk from the first (or only) connection.
Public methodRead(Byte, Int32, Int32, ConnectionReadDelegate)
Reads the next chunk from the first (or only) connection.
Public methodRestartConnection
Closes the connection and then establishes the connection.
Public methodWrite(Byte, Int32)
Writes the content of the buffer to every connection.
Public methodWrite(Byte, Int32, Int32, Int32)
Writes the content of the buffer to every connection.
Top
Events
  NameDescription
Public eventActivityRecorded
Raised when an activity is recorded by the connector.
Public eventAddingConnection
Raised when a connection has been established. The connection will not yet be in the list of established connections, writes on the connector will not go to this connection. Usually raised from a background thread.
Public eventConnectionClosed
Raised when a connection has been permanently closed. This will usually be raised from a background thread.
Public eventConnectionEstablished
Raised when a connection has been established. This will usually be raised from a background thread. The connection will be in the list of established connections when this is raised.
Public eventConnectionStateChanged
Raised when a connection's connection state has changed. This will usually be raised from a background thread. Sender will either be an IConnection or this IConnector.
Public eventExceptionCaught
Raised when an exception is caught on the background thread. The background thread should not pass ThreadAbortException through this.
(Inherited from IBackgroundThreadExceptionCatcher.)
Top
Remarks

Connectors do the work of establishing a link with another machine or a piece of hardware. The intention is that the connector is created by another object that then either sends or receives a stream of bytes over the connection.

Connectors and their child connections have the capacity to generate a LOT of exceptions under the right conditions. All exceptions are caught and routed through the background thread exception event. The last exception raised is also recorded.

You cannot instantiate an IConnector. There are other interfaces that are based on this that you can instantiate.

See Also