 				disconnect(withError: stream.streamError)
 			case Stream.Event.hasBytesAvailable:
 				let data = inputStream!.readAllData()
-				delegateQueue?.async {
+				delegateQueue.async {
 					self.delegate?.socket(self, didReceiveData: data)
 				}
 			case Stream.Event.endEncountered:

			}
			self.disposeStreams()
			self.status = .closed(error)
			self.delegateQueue?.async {
				self.delegate?.socket(self, didDisconnectWithError: error)
			}
		}

		}
	}
	
	public var delegateQueue: DispatchQueue {
		get {
			return synchronized(self) {
				return unsafeDelegateQueue
