         
         Stream.doWrite(uv_buf_const_ptr(buffer), handle: handle)
         
-//        self.setTimeout(100){ [unowned self]
-//            _ in
-//            self.close()
-//        }
+        Socket.onTimeout(100){ [unowned self]
+            _ in
+            self.close()
+        }
     }
     
     public func close() {
     
         Handle.close(uv_handle_ptr(handle))
-    }
-    
-    public func setTimeout( msecs : UInt64, callback : ((uv_timer_ptr)->()) ) {
-        
-        let timer : Timer = Timer()
-        timer.event.onTimeout = callback
-        Timer.start(timer.timerhandle, timeout: msecs, count: 0)
     }
     
     public func setKeepAlive(msecs: UInt32) {

            Socket.dictionary.removeValueForKey(uv_stream_ptr(handle))
        }
    }
        
}


        }
        
        Tcp.bind(self.server.tcpHandle, address : self.ip, port: self.port)
        Tcp.listen(self.server.tcpHandle)
    
        Loop.run(mode: UV_RUN_DEFAULT)
    }
    
}