System.Net.Socket.TSocket.Bind
Delphi
procedure Bind(const Endpoint: TNetEndpoint); overload;
procedure Bind(Port: Word); overload;
C++
void __fastcall Bind(const TNetEndpoint &Endpoint)/* overload */;
void __fastcall Bind(System::Word Port)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | System.Net.Socket.pas System.Net.Socket.hpp |
System.Net.Socket | TSocket |
Description
Associates your socket with a local adapter (either physical hardware or a virtual device) in the specified endpoint or local port.
Exceptions
A call to Bind can raise any of the following exceptions:
Exception | Exception.Message | Scenarios |
---|---|---|
Can't create new socket |
| |
Network socket error: <error message> (<error code>), on API 'bind' |
| |
Network socket error: <error message> (<error code>), on API 'socket' |
| |
Socket already open |
|