     /// - 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 self._establishEndPoint(url: url, name: name, type: .Bind, {
-            try url.absoluteString.withCString { address in
-                let endPointId = nn_bind(self.fileDescriptor, address)
-
-                guard (endPointId >= 0) else {
-                    throw NanoMessageError.BindToURL(code: nn_errno(), url: url)
-                }
-
-                return endPointId
+        return try self._establishEndPoint(url: url, name: name, type: .Bind, { address in
+            let endPointId = nn_bind(self.fileDescriptor, address)
+
+            guard (endPointId >= 0) else {
+                throw NanoMessageError.BindToURL(code: nn_errno(), url: url)
             }
+
+            return endPointId
         })
     }
 

    ///
    /// - 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, _ establishEndPoint: () throws -> CInt) throws -> EndPoint {
        var receivePriority: Priority?
        var sendPriority: Priority?



        let ipv4Only = try self.getIPv4Only()

        return try url.absoluteString.withCString { address -> EndPoint in
            let endPointId = try establishEndPoint(address)

            let endPoint = EndPoint(id:         Int(endPointId),
                                    url:        url,
                                    type:       type,
                                    priorities: SocketPriorities(receivePriority: receivePriority, sendPriority: sendPriority),
                                    ipv4Only:   ipv4Only,
                                    name:       name)

            self.endPoints.insert(endPoint)

            return endPoint
        }
    }

    /// Adds a local endpoint to the socket. The endpoint can be then used by other applications to connect to.
