 	static func remove(socket: SocketType) {
 		if let n = NetEvent.staticEvent {
 			n.lock.doWithLock {
-				if let _ = n.queuedSockets[socket] {
-#if os(Linux)
-					epoll_ctl(n.kq, EPOLL_CTL_DEL, socket, nil)
+				if let fnd = n.queuedSockets[socket] {
+#if os(Linux)
+					var evt = event()
+					evt.events = fnd.what.epollEvent
+					evt.data.fd = socket
+					epoll_ctl(n.kq, EPOLL_CTL_DEL, socket, &evt)
 #else
 					var kvt = event(ident: UInt(socket), filter: Int16(EV_DELETE), flags: UInt16(EV_DELETE), fflags: 0, data: 0, udata: nil)
 					var tmout = timespec(tv_sec: 0, tv_nsec: 0)

#endif
						if let qitm = self.queuedSockets.removeValue(forKey: sock) {
							qitm.callback(sock, filter)
						} else {
							print("not found!")
						}

#if os(Linux)
				var evt = event()
				evt.events = what.epollEvent | EPOLLONESHOT.rawValue | EPOLLET.rawValue
				epoll_ctl(n.kq, EPOLL_CTL_ADD, socket, &evt)
#else
				var kvt = event(ident: UInt(socket), filter: what.kqueueFilter, flags: UInt16(EV_ADD | EV_ENABLE | EV_ONESHOT), fflags: 0, data: 0, udata: nil)
