From d0d36795e807cf72295c6e73813e0c2daa0a71e7 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 23 Aug 2007 22:06:04 +0000 Subject: Craquity craq De-craq! This is probably broken on windows, do not attempt to use there yet unless you like broken stuff. Cant say for sure as i havent even tried to build yet and most likely wont tonight. --- Abstract most of the berkely socket API out into SocketEngine derived classes. SocketEngine base class implements standard berkely sockets that 'real mens systems' like linux and freebsd have. For socketengine_iocp we implement the windows specific nonesense like the special things needed for udp and accept (ick). All this to eliminate a bunch of ifdefs. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7810 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/users.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 4854849ad..ccf506697 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -436,8 +436,8 @@ char* userrec::MakeHostIP() void userrec::CloseSocket() { - shutdown(this->fd,2); - close(this->fd); + ServerInstance->SE->Shutdown(this, 2); + ServerInstance->SE->Close(this); } char* userrec::GetFullHost() @@ -727,11 +727,8 @@ void userrec::FlushWriteBuf() if ((sendq.length()) && (this->fd != FD_MAGIC_NUMBER)) { int old_sendq_length = sendq.length(); -#ifndef WIN32 - int n_sent = write(this->fd, this->sendq.data(), this->sendq.length()); -#else - int n_sent = send(this->fd, (const char*)this->sendq.data(), this->sendq.length(), 0); -#endif + int n_sent = ServerInstance->SE->Send(this, this->sendq.data(), this->sendq.length(), 0); + if (n_sent == -1) { if (errno == EAGAIN) -- cgit v1.2.3