July 17, 2010, 6:10 p.m.
posted by irds
System.Net.SocketsSometimes programmers need to work at an even lower level of abstraction than the WebRequest and WebResponse objects that live in the System.Net namespace, particularly when porting legacy code. One popular low-level interface is the Berkeley Sockets interface. The System.Net.Sockets interface provides a managed code connection to this subsystem. It uses a number of objects from the System.Net namespace. The base object of the Socket subsystem is, naturally, the Socket. After creating and configuring the Socket to your liking, you read and write data to it using a Network- Stream object, which maps the System.IO.Stream interface onto the socket's network connection. The LingerOption object contains information about whether the connection should linger after closing the socket, and if so, for how long. The MulticastOption object contains the collection of IP addresses to which to send multicast packets. Figure lists a number of enumerations in the socket class for specifying various options.
The System.Net.Sockets namespace contains one new exception class, named SocketException. |
- Comment