System.Net.Sockets.Socket Class

Overview

The System.Net.Sockets.Socket class represents a network endpoint over which one or more streams can be established. A socket is the fundamental building block for network communication in .NET.

Class Summary

Represents a network endpoint over which one or more streams can be established.

Namespace: System.Net.Sockets

Assembly: System.Net.Sockets (4.0.0.0)

Properties

SocketStream

Gets the stream associated with the socket.

Type: System.Net.Sockets.NetworkStream

Connected

Gets a value indicating whether the socket is currently connected.

Type: bool

RemoteEndPoint

Gets the endpoint of the remote end of the socket.

Type: System.Net.EndPoint

Methods

Accept()

Waits for an incoming connection on the socket.

Signature: public System.Net.Sockets.NetworkStream Accept()

Returns: NetworkStream

Disconnect()

Disconnects the socket from its current connection.

Signature: public void Disconnect()

Returns: void