Share via


System.Net.Sockets Namespace

Microsoft Silverlight will reach end of support after October 2021. Learn more.

The System.Net.Sockets namespace provides a managed implementation of the sockets networking interface for developers who need to tightly control access to the network. On Windows, the System.Net.Sockets namespace provides a managed implementation of the Windows Sockets (Winsock) interface. On Apple Mac OS X, the System.Net.Sockets namespace provides a managed implementation of the sockets interface based on Berkeley Software Distribution (BSD) UNIX.

The System.Net.Sockets namespace provides a mechanism for real-time duplex communication with remote network resources and enables higher-level APIs to communicate over a bi-directional transport. This also allows an application to interoperate as a client with existing TCP services. For more information, see Working with Sockets.

The System.Net.Sockets namespace in Silverlight 4 has added support for UDP multicast clients. For more information, see Working with Multicast.

Silverlight for Windows Phone For additional socket methods for Windows Phone, see SocketExtensions.

Classes

  Class Description
Public class Socket Implements the Berkeley sockets interface.
Public class SocketAsyncEventArgs Represents an asynchronous socket operation.
Public class SocketException The exception that is thrown when a socket error occurs.
Public class UdpAnySourceMulticastClient A client receiver for multicast traffic from any source, also known as Any Source Multicast (ASM) or Internet Standard Multicast (ISM).
Public class UdpSingleSourceMulticastClient A client receiver for multicast traffic from a single source, also known as Source Specific Multicast (SSM).

Enumerations

  Enumeration Description
Public enumeration AddressFamily Specifies the addressing scheme that an instance of the Socket class can use.
Public enumeration ProtocolType Specifies the protocol that the Socket class supports.
Public enumeration SocketAsyncOperation The type of asynchronous socket operation most recently performed with this object.
Public enumeration SocketClientAccessPolicyProtocol Specifies the method to download the policy file that an instance of the Socket class will use.
Public enumeration SocketError Defines error codes for the Socket class.
Public enumeration SocketShutdown Defines constants that are used by the Socket.Shutdown method.
Public enumeration SocketType Specifies the type of socket that an instance of the Socket class represents.