         let ipv4Only = try getIPv4Only()
 
         let endPointId = try url.absoluteString.withCString { address -> Int in
-            let returnCode = nanomsgCall(address)
+            let returnCode = funcCall(address)
 
             guard (returnCode >= 0) else {
-                throw nanomsgError(nn_errno())
+                throw failure(nn_errno())
             }
 
             return Int(returnCode)

    /// Establish an endpoint on the socket.
    ///
    /// - Parameters:
    ///   - url:                Consists of two parts as follows: transport://address. The transport specifies the
    ///                         underlying transport protocol to use. The meaning of the address part is specific
    ///                         to the underlying transport protocol.
    ///   - name:               An optional endpoint name.
    ///   - type:               The connection type used to establish the endpoint.
    ///   - establishEndPoint:  Closure used to establish the endpoint.
    ///
    /// - Throws:  `NanoMessageError.GetSocketOption`
    ///
    /// - Returns: An endpoint that has just been established. The endpoint can be later used to remove the
    ///            endpoint from the socket via `removeEndPoint()` function.
    private func _establishEndPoint(url:                URL,
                                    name:               String,
                                    type:               ConnectionType,
                                    call  nanomsgCall:  (UnsafePointer<Int8>) -> CInt,
                                    error nanomsgError: (CInt) -> NanoMessageError) throws -> EndPoint {
        var receivePriority: Priority?
        var sendPriority: Priority?


    /// - Note:    Note that `bindToURL()` may be called multiple times on the same socket thus allowing the
    ///            socket to communicate with multiple heterogeneous endpoints.
    public func bindToURL(_ url: URL, name: String = "") throws -> EndPoint {
        return try _establishEndPoint(url:      url,
                                      name:     name,
                                      type:     .Bind,
                                      funcCall: { address in
                                          return nn_bind(fileDescriptor, address)
                                      },
                                      failure:  { errno in
                                          return .BindToURL(code: errno, url: url)
                                      })
    }
