| C# | Visual Basic |
public class IrDAClient : IDisposable
Public Class IrDAClient _ Implements IDisposable
| All Members | Constructors | Methods | Properties | ||
| Icon | Member | Description |
|---|---|---|
| IrDAClient()()() |
Initializes a new instance of the IrDAClient class.
| |
| IrDAClient(String) |
Initializes a new instance of the IrDAClient
class and connects to the specified service name.
| |
| IrDAClient(IrDAEndPoint) |
Initializes a new instance of the IrDAClient
class and connects to the specified endpoint.
| |
| 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.
| |
| 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).
| |
| Client |
Gets or sets the underlying Socket.
| |
| Close()()() |
Closes the socket of the connection.
| |
| Connect(IrDAEndPoint) |
Forms a connection to the specified endpoint.
| |
| Connect(String) |
Forms a connection to the specified service on an arbitrary peer.
| |
| Connected |
Gets a value indicating whether the underlying Socket for an IrDAClient is connected to a remote host.
| |
| 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(Boolean) |
Releases the unmanaged resources used by the IrDAClient and optionally releases the managed resources.
| |
| Dispose()()() | ||
| EndConnect(IAsyncResult) |
Asynchronously accepts an incoming connection attempt.
| |
| Equals(Object) | (Inherited from Object.) | |
| Finalize()()() |
Frees resources used by the IrDAClient class.
(Overrides Object.Finalize()()().) | |
| GetHashCode()()() | Serves as a hash function for a particular type. GetHashCode()()() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.) | |
| GetRemoteMachineName(Socket) |
Gets the name of the peer device using the specified socket.
| |
| GetStream()()() |
Returns the NetworkStream used to send and receive data.
| |
| GetType()()() | Gets the Type of the current instance. (Inherited from Object.) | |
| MemberwiseClone()()() | Creates a shallow copy of the current Object. (Inherited from Object.) | |
| RemoteMachineName |
Gets the name of the peer device participating in the communication.
| |
| ToString()()() | (Inherited from Object.) |
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.
- OBEX file transfer OBEX:IrXfer, (TinyTP)
- OBEX general OBEX, (TinyTP)
- Printing IrLPT, IrLMP mode
- IrCOMM e.g. to modems IrDA:IrCOMM, IrCOMM 9-Wire/Cooked mode
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| Object | |
| IrDAClient | |