     // MARK: -
 
     public func write(data: DispatchData <Void>, callback: Result <Void> -> Void) {
-
         precondition(state == .Connected)
-
         dispatch_io_write(channel, 0, data.data, queue) {
             (done, data, error) in
-
-//            print("WRITE: \(done) \(data) \(error)")
-            // TODO: Handle done
-
             guard error == 0 else {
                 callback(Result.Failure(Errno(rawValue: error)!))
                 return
             }
-
             callback(Result.Success())
         }
     }
 
+// mark: -
+
+    private func stateChanged(old old: State, new: State) {
+        stateChangeCallback?(old, new)
+
+        switch (old, new) {
+            case (_, .Connected):
+
+                if queue == nil {
+                    let queueAttribute = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, qos, 0)
+                    queue = dispatch_queue_create("io.schwa.SwiftIO.UDP.receiveQueue", queueAttribute)
+                }
+
+                let channel = dispatch_io_create(DISPATCH_IO_STREAM, socket.descriptor, queue) {
+                    [weak self] (error) in
+
+                    guard let strong_self = self else {
+                        return
+                    }
+
+                    try! strong_self.handleDisconnect()
+                }
+                dispatch_io_set_low_water(channel, 0)
+                self.channel = channel
+                startReading()
+            default:
+                break
+        }
+    }
 
     /// Callback might be called 0 or more times.
     private func startReading() {

        disconnectCallback?(Result.Success())
        disconnectCallback = nil
    }
}


            strong_self.state = .Connecting

            let socket = try! Socket.TCP()

            try! socket.connect(address, port: port)

            strong_self.socket = socket
            strong_self.state = .Connected

            callback(Result.Success())
        }
