Initializes a new instance of the Socket class.
[Visual Basic] Overloads Public Sub New( _ ByVal af As Integer, _ ByVal type As Integer, _ ByVal pr As Integer _ ) [C#] public Socket( int af, int type, int pr ); [C++] public: Socket( int af, int type, int pr ); [JScript] public function Socket( af : int, type : int, pr : int );
Exception Type | Condition |
---|---|
ArgumentException | The combination of address family, socket type, and protocol results in an invalid socket. |
The address family, socket type, and protocol parameters are not independent. Some address families restrict the protocols that can be used with them, and often the socket type is implicit in the protocol used. If the combination of address family, socket type, and protocol results in and invalid socket, then an exception is thrown.
The valid address families are defined in the AddressFamily class. The valid socket types are defined in the SocketType class. The valid protocol types are defined in the ProtocolType class.
Socket Class | Socket Members | System.Net.Sockets Namespace | Socket Constructor Overload List