Share via


Socket Members

The following tables list the members exposed by the Socket type.

Public Constructors

Name Description
Public Method Socket Initializes a new instance of the Socket class.

Public Properties

Name Description
Public Property Available Gets the amount of data that has been received from the network and is available to be read.
Public Property LocalEndPoint Gets the local endpoint that the current socket is using for communications.
Public Property ReceiveTimeout Gets or sets a value that specifies the amount of time after which a synchronous Receive call will time out.
Public Property RemoteEndPoint Gets the remote endpoint with which the current socket is communicating.
Public Property SendTimeout Gets or sets a value that specifies the amount of time after which a synchronous Send call will time out.

Public Methods

Name Description
Public Method Accept Creates a socket for a newly created connection.
Public Method Bind Associates a socket with a local endpoint.
Public Method Close Closes the current socket connection and releases all resources associated with that connection.
Public Method Connect Establishes a connection to a remote host.
Public Method Equals (Inherited from Object.)
Public Method GetHashCode (Inherited from Object.)
Public Method GetSocketOption Overloaded. Gets the setting of the current socket's specified configuration option.
Public Method GetType (Inherited from Object.)
Public Method Listen Enables the current socket to listen for incoming connection attempts.
Public Method Poll Determines the read/write status of the current socket for a specified polling mode.
Public Method Receive Overloaded. Receives data from a bound socket and places the data in a buffer array.
Public Method ReceiveFrom Overloaded. Receives data from an unbound socket, places the data in a buffer array, and gets the data's endpoint.
Public Method ReferenceEquals (Inherited from Object.)
Public Method Send Overloaded. Sends data to a bound socket.
Public Method SendTo Overloaded. Sends data to an unbound socket.
Public Method SetSocketOption Overloaded. Sets the specified configuration option for the current socket.
Public Method ToString (Inherited from Object.)

Protected Methods

Name Description
Protected Method Dispose Releases the unmanaged resources used by the current socket, and optionally releases the managed resources also.
Protected Method MemberwiseClone (Inherited from Object.)

Explicit Interface Implementations

Name Description
Explicit Interface ImplementationMethod System.IDisposable.Dispose Releases all resources used by the current socket.

See Also

Reference

Socket Class
System.Net.Sockets Namespace