00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef _COMMUN_SOCKET_H_
00036 #define _COMMUN_SOCKET_H_
00037
00038 #include "../main/includes.h"
00039 #include "../commun/commun.h"
00040 #include "../string/string.h"
00041 #include "../commun/buffer.h"
00042
00053 class CommunSocket: public Commun {
00054
00055 #ifdef WIN32
00056
00057 SOCKET _sock;
00058
00060 SOCKET _csock;
00061 #else
00062
00063 int _sock;
00064
00066 int _csock;
00067 #endif
00068
00070 fd_set _fds;
00071
00075 String _hostname;
00076
00082 unsigned short _port;
00083
00085 int _connectMode;
00086
00087 public:
00088
00098 CommunSocket( int connectMode, const String& hostname, unsigned short port);
00099
00103 virtual ~CommunSocket();
00104
00114 virtual int initialize();
00115
00125 virtual Commun& operator>>( Buffer& b);
00126
00136 virtual Commun& operator<<( const Buffer& b);
00137
00145 virtual int isReady();
00146 };
00147
00148 #endif // _COMMUN_SOCKET_H_