public class IrDAClient : IDisposable
Public Class IrDAClient
Implements IDisposable
public ref class IrDAClient : IDisposable
type IrDAClient =
class
interface IDisposable
end
Makes connections to services on peer IrDA devices. It allows discovery of all devices in range, then a connection can be made to the required service on the chosen peer. Or, given just the service name a connection will be made to an arbitrary peer. This is most useful when it is expected that there will be only one device in range—as is often the case.
It can be used with both the full and Compact frameworks, and can be used as a replacement for the latter's built-in version simply by changing the referenced namespace and assembly. It also has features extra to those in the CF's version. For instance, following the pattern of TcpClient in framework version 2, it provides access to the underlying Socket via a Client property. This is particularly useful as it allows setting socket options, for instance IrCOMM Cooked mode with option NineWireMode.
There a number of well-known services, a few are listed here.
Of course the library also includes specific OBEX protocol support, both client and server, see ObexWebRequest etc.
Public Shared Sub Main()
Dim cli As New IrDAClient
' Set IrCOMM Cooked/9-wire mode.
cli.Client.SetSocketOption(IrDASocketOptionLevel.IrLmp, _
IrDASocketOptionName.NineWireMode, _
1) ' equivalent to 'True'
' Connect
cli.Connect("IrDA:IrCOMM")
' Connected, now send and receive e.g. by using the
' NetworkStream returned by cli.GetStream
...
End Sub
IrDAClient | Initializes a new instance of the IrDAClient class. |
IrDAClient(IrDAEndPoint) | Initializes a new instance of the IrDAClient class and connects to the specified endpoint. |
IrDAClient(String) | Initializes a new instance of the IrDAClient class and connects to the specified service name. |
Active | Gets or set a value that indicates whether a connection has been made. |
Available | The number of bytes of data received from the network and available to be read. |
Client | Gets or sets the underlying Socket. |
Connected | Gets a value indicating whether the underlying Socket for an IrDAClient is connected to a remote host. |
RemoteMachineName | Gets the name of the peer device participating in the communication. |
BeginConnect(IrDAEndPoint, AsyncCallback, Object) | Begins an asynchronous request for a remote host connection. The remote host is specified by an endpoint. |
BeginConnect(String, AsyncCallback, Object) | Begins an asynchronous request for a remote host connection. The remote host is specified by a service name (string). |
Close | Closes the IrDAClient and the underlying connection. |
Connect(IrDAEndPoint) | Forms a connection to the specified endpoint. |
Connect(String) | Forms a connection to the specified service on an arbitrary peer. |
ConnectAsync | Connects the client to the specified service on an arbitrary peer as an asynchronous operation. |
DiscoverDevices | Obtains information about available devices. |
DiscoverDevices(Int32) | Obtains information about a specified number of devices. |
DiscoverDevices(Int32, Socket) | Obtains information about available devices using a socket. |
Dispose | Closes the IrDAClient and the underlying connection. |
Dispose(Boolean) | Releases the unmanaged resources used by the IrDAClient and optionally releases the managed resources. |
EndConnect | Asynchronously accepts an incoming connection attempt. |
Equals | (Inherited from Object) |
Finalize | (Overrides ObjectFinalize) |
GetHashCode | (Inherited from Object) |
GetRemoteMachineName | Gets the name of the peer device using the specified socket. |
GetStream | Returns the NetworkStream used to send and receive data. |
GetType | (Inherited from Object) |
MemberwiseClone | (Inherited from Object) |
ToString | (Inherited from Object) |