Discuss this help topic in SecureBlackbox Forum

TElSocket.Bind

TElSocket     See also     


Filter: C#  VB.NET  Pascal  C++  PHP  Java  


Binds the socket to the specified local address and port.

Declaration

[C#]
    int Bind();
    int Bind(bool Outgoing);
    int Bind(bool Outgoing, bool ReuseAddress);

[VB.NET]
    Function Bind() As Integer
    Function Bind(ByVal Outgoing As Boolean) As Integer
    Function Bind(ByVal Outgoing As Boolean, ByVal ReuseAddress As Boolean) As Integer

[Pascal]
    function Bind() : integer;
    function Bind(Outgoing : boolean) : integer;
    function Bind(Outgoing : boolean; ReuseAddress : boolean) : integer;

[C++]
    int32_t Bind();
    int32_t Bind(bool Outgoing);
    int32_t Bind(bool Outgoing, bool ReuseAddress);

[PHP]
    integer Bind()
    integer Bind(bool $Outgoing)
    integer Bind(bool $Outgoing, bool $ReuseAddress)

[Java]
    int bind(boolean Outgoing, boolean ReuseAddress);
    int bind();
    int bind(boolean Outgoing);

Parameters

  • Outgoing - specifies if the socket should be bound for outgoing connection.
  • ReuseAddress - setting this parameter to True tells the socket to use SO_REUSEADDR option of socket API. This reduces the wait time, i.e., the time during which the released port can not be bound to. The default value is False.

Return value

    Returns 0 if binding was successful and socket error code otherwise.
    In .NET, if an exception has been rised, -1 may be returned.

Description

    Use this method to bind the socket to the specified local address and port. The local address is specified by ListenAddress property, and local port is specified by ListenPort.

See also:     Listen     ListenAddress     ListenPort     BoundAddress     BoundPort     OutgoingLocalBinding    

Discuss this help topic in SecureBlackbox Forum