Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 2.0
System.Net.Sockets
IrDAListener Class

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
.NET Framework Class Library
IrDAListener Class

Places a socket in a listening state to monitor infrared connections from a specified service or network address.

Namespace: System.Net.Sockets
Assembly: System.Net.IrDA (in system.net.irda.dll)

Visual Basic (Declaration)
Public Class IrDAListener
Visual Basic (Usage)
Dim instance As IrDAListener
C#
public class IrDAListener
C++
public ref class IrDAListener
J#
public class IrDAListener
JScript
public class IrDAListener

This class monitors a service by specifying a service name or a network address. The listener does not listen until you call the Start method.

The following code example creates a connection, with the IrDAEndPoint class, and starts listening for incoming requests from that device. This code example is part of a larger example provided for the IrDAClient class.

Visual Basic
' 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
    Dim i As Integer = ListBox1.SelectedIndex
    irEndP = New IrDAEndPoint(irDevices(i).DeviceID, irServiceName)
    irListen = New IrDAListener(irEndP)
    irListen.Start()
Catch exSoc As SocketException
    MsgBox("Couldn't listen on service " & irServiceName & ": " _
        & exSoc.ErrorCode)
End Try
C#
// 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);
}
System.Object
   System.Net.EndPoint
    System.Net.Sockets.IrDAListener
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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

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

.NET Compact Framework

Supported in: 2.0, 1.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker