Commit 70a58f74 authored by jan.koester's avatar jan.koester
Browse files

added nonblock method

parent afae5cef
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -2,8 +2,9 @@
BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x14\x00l\x00i\x00b\x00n\x00e\x00t\x00p\x00l\x00u\x00s)

[CMake]
Build Directory Count=1
Build Directory Count=2
Current Build Directory Index-Host System=0
Current Build Directory Index-Host-System=1

[CMake][CMake Build Directory 0]
Build Directory Path=/home/intranet.tuxist.de/jan.koester/Projects/libnetplus/build
@@ -15,5 +16,15 @@ Extra Arguments=
Install Directory=
Runtime=Host System

[CMake][CMake Build Directory 1]
Build Directory Path=/home/intranet.tuxist.de/jan.koester/Projects/libnetplus/build
Build Type=Debug
CMake Binary=/usr/bin/cmake
CMake Executable=/usr/bin/cmake
Environment Profile=
Extra Arguments=
Install Directory=/usr/local
Runtime=Host-System

[Project]
VersionControlSupport=kdevgit
+4 −0
Original line number Diff line number Diff line
@@ -139,6 +139,10 @@ void netplus::tcp::listen(){
    }
}

void netplus::tcp::setNonBlock(){
    setFlag(O_NONBLOCK,1);
}

netplus::tcp& netplus::tcp::operator=(int sock){
     _Socket=sock;
     return *this;
+4 −0
Original line number Diff line number Diff line
@@ -139,6 +139,10 @@ void netplus::udp::listen(){
    }
}

void netplus::udp::setNonBlock(){
    setFlag(O_NONBLOCK,1);
}

netplus::udp& netplus::udp::operator=(SOCKET sock){
     _Socket=sock;
     return *this;
+5 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@
#ifndef Windows  
typedef int SOCKET;
typedef unsigned long ULONG_PTR;
#include <sys/socket.h>
#else
#include <WinSock2.h>
#include <mswsock.h>
@@ -60,6 +61,8 @@ namespace netplus {
            virtual void             bind()=0;
            virtual void             listen()=0;
            
            virtual void            setNonBlock()=0;

            virtual int              getMaxconnections()=0;
            
            virtual size_t           sendData(void *data, unsigned long size,int flags=0)=0;
@@ -102,6 +105,7 @@ namespace netplus {
            void          accept(socket *ssock);
            void          bind();
            void          listen();
            void          setNonBlock();
            tcp&          operator=(SOCKET socket);

            int           getMaxconnections();
@@ -134,6 +138,7 @@ namespace netplus {
#endif
            void          bind();
            void          listen();
            void          setNonBlock();

            udp&          operator=(SOCKET socket);

+4 −0
Original line number Diff line number Diff line
@@ -117,6 +117,10 @@ void netplus::tcp::listen(){
    }
}

void netplus::tcp::setNonBlock(){
    setFlag(FIONBIO, 0);
}

netplus::tcp& netplus::tcp::operator=(SOCKET sock){
     _Socket=sock;
     return *this;
Loading