RealTimeServerConnectionManager.BeginStartListening Method

Definition

Overloads

BeginStartListening(Int32, AsyncCallback, Object)

Starts listening on default addresses on the specified port.

BeginStartListening(Int32, IEnumerable<IPAddress>, StartListeningOptions, AsyncCallback, Object)

Starts listening on default addresses on the specified port.

BeginStartListening(Int32, AsyncCallback, Object)

Starts listening on default addresses on the specified port.

public:
 IAsyncResult ^ BeginStartListening(int port, AsyncCallback ^ userCallback, System::Object ^ state);
public IAsyncResult BeginStartListening (int port, AsyncCallback userCallback, object state);
member this.BeginStartListening : int * AsyncCallback * obj -> IAsyncResult
Public Function BeginStartListening (port As Integer, userCallback As AsyncCallback, state As Object) As IAsyncResult

Parameters

port
Int32

The port that should be used for all addresses.

userCallback
AsyncCallback

The method to be called when the asynchronous operation is completed.

state
Object

A user-provided object that distinguishes this particular asynchronous operation from other asynchronous operations.

Returns

An IAsyncResult that references the asynchronous operation.

Remarks

If 0 is passed for port, a port is randomly chosen and attempted. An exception may be raised if the same port is not available on all interfaces. This is generally useful only in testing when two applications are in the same process.

It is recommended that an explicit port be chosen instead of 0. The address and port need to be known and configured by other applications in order to communicate. This is not practical when it is randomly chosen.

Applies to

BeginStartListening(Int32, IEnumerable<IPAddress>, StartListeningOptions, AsyncCallback, Object)

Starts listening on default addresses on the specified port.

public:
 IAsyncResult ^ BeginStartListening(int port, System::Collections::Generic::IEnumerable<System::Net::IPAddress ^> ^ addresses, Microsoft::Rtc::Signaling::StartListeningOptions ^ options, AsyncCallback ^ userCallback, System::Object ^ state);
public IAsyncResult BeginStartListening (int port, System.Collections.Generic.IEnumerable<System.Net.IPAddress> addresses, Microsoft.Rtc.Signaling.StartListeningOptions options, AsyncCallback userCallback, object state);
member this.BeginStartListening : int * seq<System.Net.IPAddress> * Microsoft.Rtc.Signaling.StartListeningOptions * AsyncCallback * obj -> IAsyncResult
Public Function BeginStartListening (port As Integer, addresses As IEnumerable(Of IPAddress), options As StartListeningOptions, userCallback As AsyncCallback, state As Object) As IAsyncResult

Parameters

port
Int32

The port that should be used for all addresses.

addresses
IEnumerable<IPAddress>

A list of addresses to listen on, or null to listen on all available addresses.

options
StartListeningOptions

Options to use, or null to use the defaults.

userCallback
AsyncCallback

The method to be called when the asynchronous operation is completed.

state
Object

A user-provided object that distinguishes this particular asynchronous operation from other asynchronous operations.

Returns

An IAsyncResult that references the asynchronous operation.

Remarks

If 0 is passed for port, a port is randomly chosen and attempted. An exception may be raised if the same port is not available on all interfaces. This is generally useful only in testing when two applications are in the same process.

It is recommended that an explicit port be chosen instead of 0. The address and port need to be known and configured by other applications in order to communicate. This is not practical when it is randomly chosen.

Applies to