This documentation is archived and is not being maintained.

IrDAEndPoint.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
)
public IrDAEndPoint (
	byte[] irdaDeviceID, 
	String serviceName
)
public function IrDAEndPoint (
	irdaDeviceID : byte[], 
	serviceName : String
)
Not applicable.

Parameters

irdaDeviceID

The device identifier.

serviceName

The name of the service to connect to.

Exception typeCondition

ArgumentException

Either the device identifier or the service name is invalid.

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

The following code example uses an IrDAEndPoint to create a connection to a device, as selected from a list box of remote participating devices, and then uses an IrDAListener to listen for infrared communications from the remote device. This code 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 Pocket PC, Windows Mobile for Smartphone

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Compact Framework

Supported in: 2.0, 1.0
Show: