             throw NanoMessageError.ConnectToAddress(code: nn_errno(), address: endPointAddress)
         }
 
-        var receivePriority: Int?
-        var sendPriority: Int?
-
-        if let _: Int = try? getSocketOption(socketFd, .ReceiveFd) {                  // if this is a receiver socket then...
-            receivePriority = try getSocketOption(self.socketFd, .ReceivePriority)    // obtain the receive priority for the end-point.
-        }
-        if let _: Int = try? getSocketOption(socketFd, .SendFd) {                     // if this is a sender socket then...
-            sendPriority = try getSocketOption(self.socketFd, .SendPriority)          // obtain the send priority for the end-point.
-        }
-
-        let endPoint = EndPoint(endPointId: Int(endPointId), endPointAddress: endPointAddress, connectionType: .ConnectToAddress,
-                                receivePriority: receivePriority, sendPriority: sendPriority, endPointName: endPointName)
+        let priority: (receive: Int?, send: Int?) = try _endPointPriorities()
+
+        let endPoint = EndPoint(endPointId: Int(endPointId),
+                                endPointAddress: endPointAddress,
+                                connectionType: .ConnectToAddress,
+                                receivePriority: priority.receive,
+                                sendPriority: priority.send,
+                                endPointName: endPointName)
 
         self.endPoints.insert(endPoint)
 

}

extension NanoSocket {
/// Adds a local endpoint to the socket. The endpoint can be then used by other applications to connect to.
///
/// - Parameters:

            throw NanoMessageError.BindToAddress(code: nn_errno(), address: endPointAddress)
        }

        let priority: (receive: Int?, send: Int?) = try _endPointPriorities()

        let endPoint = EndPoint(endPointId: Int(endPointId),
                                endPointAddress: endPointAddress,
                                connectionType: .BindToAddress,
                                receivePriority: priority.receive,
                                sendPriority: priority.send,
                                endPointName: endPointName)

        self.endPoints.insert(endPoint)

