Click or drag to resize

Connection Class

Abstract base Connection class
Inheritance Hierarchy

Namespace:  Brainboxes.IO
Assembly:  Brainboxes.IO (in Brainboxes.IO.dll) Version: 1.5.0.0 (1.5.0.0)
Syntax
public abstract class Connection : IConnection, 
	IDisposable

The Connection type exposes the following members.

Properties
  NameDescription
Public propertyIsAvailable
Whether the Device is Available, e.g. on-line or off-line
Public propertyIsConnected
Whether the Device is Connected
Public propertyStream
The Connections underlying stream class
Public propertyTimeout
The timeout for Stream reads and writes, and connection availability test
Top
Methods
  NameDescription
Public methodConnect
Connect to the ED Device
Public methodStatic memberCode exampleCreate
Supply a connection IP address or com port and the correct IConnection concrete class will be created and returned
Examples
IConnection c1 = Connection.Create("192.168.0.5"); // returns a TCPConnection class IConnection c2 = Connection.Create("COM6", 9600); //returns a SerialConnection class with the baud rate set to 9600
Public methodDisconnect
Disconnect from the ED Device
Public methodDispose
Dispose of this Brainboxes device
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodToString
ToString
(Overrides ObjectToString.)
Top
Events
  NameDescription
Public eventConnectionStatusChangedEvent
When the status of the connection changes this event is raised e.g. when IsConnected changes from false to true or when IsAvailable changes: * for example for a TCPConnection if the IP address is goes from on-line to off-line * or for example for a SerialConnection when the COM name is no longer present or in use by another program
Top
See Also