 
 /// Get the time in milliseconds to allow to attempt to close a socket or endpoint.
 ///
-/// - Returns: The closure time in milliseconds.
-    fileprivate func _getClosureTimeout() -> UInt {
-        if var milliseconds = try? self.getLinger() {
-            if (milliseconds <= 0) {
-                milliseconds = 1000
+/// - Returns: The closure time in microseconds.
+    fileprivate var _closureDelay: UInt32 {
+        var milliseconds = 1000
+
+        if let linger = try? self.getLinger() {
+            if (linger > 0) {                               // account for infinate linger timeout.
+                milliseconds = linger
             }
-
-            return UInt(milliseconds)
-        }
-
-        return 1000
+        }
+
+        return UInt32((milliseconds * 1000) / self.closureAttempts)
     }
 }
 

/// A set of `EndPoint` structures that the socket is attached to either locally or remotly.
    public fileprivate(set) var endPoints = Set<EndPoint>()

    private var _closureAttempts: UInt = 10
/// The number of attempts to close down a socket or endpoint.
///
/// - Note:  The `getLinger()` function is called to determine the number of milliseconds to
///          wait for a socket/endpoint to clear and close, this is divided by `closureAttempts`
///          to determine the minimum pause between each attempt.
    public var closureAttempts: UInt {
        get {
            return self._closureAttempts
        }
        set (attempts) {
            self._closureAttempts = (attempts > 0) ? attempts : 1
        }
    }
/// Determine if when de-referencing the socket we are going to keep attempting to close the socket until successful.

    @discardableResult
    public func removeEndPoint(_ endPoint: EndPoint) throws -> Bool {
        if (self.endPoints.contains(endPoint)) {
            var loopCount = 0

            while (true) {
                let returnCode = nn_shutdown(self.socketFd, CInt(endPoint.id))  // attempt to close down the endpoint
