Mono Class Library: System.Net.Sockets.Socket Overview | MembersSystem.Net.Sockets.Socket.Bind Method |
Associates the current instance with a local endpoint. [Edit]
|
- local_end
- The local System.Net.EndPoint to be associated with the socket. [Edit]
Type Reason System.Net.SocketPermission [Edit] Requires permission to accept connections on the endpoint defined by localEP. See System.Net.NetworkAccess.Accept.
Type Reason ArgumentNullException localEP is null. [Edit] System.Net.Sockets.SocketException Note: For additional information on causes of the SocketException, see the System.Net.Sockets.SocketException class.[Edit]ObjectDisposedException The current instance has been disposed. [Edit] System.Security.SecurityException A caller in the call stack does not have the required permission. [Edit]
This method sets the Socket.LocalEndPoint property of the current instance to localEP.
Note:[Edit]For connection-oriented protocols, this method is generally used only on the server-side and is required to be called before the first call to the Socket.Listen(int) method. On the client-side, binding is usually performed implicitly by the Socket.Connect(System.Net.EndPoint) method.
For connectionless protocols, the Socket.Connect(System.Net.EndPoint)Socket.SendTo(Byte[], int, int, SocketFlags, System.Net.EndPoint), and Socket.BeginSendTo(Byte[], int, int, SocketFlags, System.Net.EndPoint, AsyncCallback, object) methods bind the current instance to the local endpoint if the current instance has not previously been bound.
Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0