[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Gets the remote endpoint.
Assembly: System (in System.dll)
If you are using a connection-oriented protocol, the property gets the EndPoint that contains the remote IP address and port number to which the Socket is connected. If you are using a connectionless protocol, contains the default remote IP address and port number with which the Socket will communicate. You must cast this EndPoint to an IPEndPoint before retrieving any information. You can then call the IPEndPoint..::..Address method to retrieve the remote IPAddress, and the IPEndPoint..::..Port method to retrieve the remote port number.
The is set after a call to either Accept or Connect. If you try to access this property earlier, will throw a SocketException. If you receive a SocketException, use the SocketException..::..ErrorCode property to obtain the specific error code. After you have obtained this code, refer to the Windows Sockets version 2 API error code documentation in the MSDN library for a detailed description of the error.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.