# ZMQSocket::bind

(PECL zmq >= 0.5.0)

ZMQSocket::bind — Bind the socket

### Description

public ZMQSocket::bind ( string `$dsn` [, bool `$force` = `FALSE` ] ) : ZMQSocket

Bind the socket to an endpoint. The endpoint is defined in format `transport://address` where transport is one of the following: inproc, ipc, tcp, pgm or epgm.

### Parameters

`dsn`

  The bind dsn, for example `transport://address`.

`force`

  Tries to bind even if the socket has already been bound to the given endpoint.

### Return Values

Returns the current object. Throws ZMQSocketException on error.