Export (0) Print
Expand All

IrDAEndPoint Constructor

Initializes a new instance of the IrDAEndPoint class.

Namespace:  System.Net
Assembly:  System.Net.IrDA (in System.Net.IrDA.dll)

public IrDAEndPoint(
	byte[] irdaDeviceId,
	string serviceName
)

Parameters

irdaDeviceId
Type: System.Byte[]

The device identifier.

serviceName
Type: System.String

The name of the service to connect to.

ExceptionCondition
ArgumentException

Either the device identifier or the service name is invalid.

After you create a connection to a device by using an IrDAEndPoint, you can monitor infrared communications from that device by using an IrDAListener.

The following example uses an IrDAEndPoint to create a connection to a device that is selected from a list of remote participating devices. It then uses an IrDAListener to listen for infrared communications from the remote device. This example is part of a larger example provided for the IrDAClient class.

// Create a connection, with the IrDAEndPoint class, 
// for the selected device in the list box. 
// Start listening for incoming requests from 
// that device with an IrDAListener object. 
try
{
    int i = listBox1.SelectedIndex;
    irEndP = new IrDAEndPoint(irDevices[i].DeviceID,
        irServiceName);
    irListen = new IrDAListener(irEndP);
    irListen.Start();
}
catch(SocketException exSoc)
{
    MessageBox.Show("Couldn't listen on service "
        + irServiceName + ": "
        + exSoc.ErrorCode);
}

Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft