EndpointPair.LocalServiceName EndpointPair.LocalServiceName EndpointPair.LocalServiceName EndpointPair.LocalServiceName EndpointPair.LocalServiceName Property

Definition

Get or set the local service name for the EndpointPair object.

public : Platform::String LocalServiceName { get; set; }
winrt::hstring LocalServiceName();

void LocalServiceName(winrt::hstring localservicename);
public string LocalServiceName { get; set; }
Public ReadWrite Property LocalServiceName As string
var string = endpointPair.localServiceName;
endpointPair.localServiceName = string;

Property Value

string string string

The local service name for the EndpointPair object.

Remarks

The LocalServiceName property can contain a service name or a TCP or UDP port number. The LocalServiceName property can be set to one of the following:

  • A numeric literal for a TCP or UDP port number (80 for the TCP port typically used for http, for example).
  • A string alias for a port number ("http", for example) that matches a string in the following file on the local computer: %WINDIR%\system32\drivers\etc\services
  • A service name that can be resolved by a namespace provider using a SRV record. The LocalServiceName property can also be set to an empty string. If the local service name is an empty string for the local endpoint before a network connection is established, then the system will automatically provide a TCP or UDP port number for the app to use when establishing a network connection.

It is an error to set the LocalServiceName property to null.

See also