diff options
Diffstat (limited to 'src/client/ClientBase.hpp')
-rw-r--r-- | src/client/ClientBase.hpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/client/ClientBase.hpp b/src/client/ClientBase.hpp index a5e76ed..dbe28bd 100644 --- a/src/client/ClientBase.hpp +++ b/src/client/ClientBase.hpp @@ -1,11 +1,19 @@ #ifndef WC_CLIENTBASE_H #define WC_CLIENTBASE_H +#ifdef _WIN32 + #include <winsock.h> +#endif + #include "../const_vars.hpp" class ClientBase { protected: +#ifdef _WIN32 + SOCKET fd; +#else int fd; +#endif char out_buffer[max_msg_len]; // for message int out_buf_used; @@ -15,7 +23,7 @@ protected: public: ClientBase(const char* ip, int port); virtual ~ClientBase(); - int ConstuctorError() const { return fd > -1 ? 0 : 1; } + int ConstuctorError() const; int Run(); void BreakLoop() { exit_flag = true; } @@ -24,7 +32,7 @@ public: virtual void AddMessage(const char *msg, const char spec_char) {} void SendMessage(const char *msg); private: - int CreateSocket(const char* ip, int port); + int InitSocket(const char* ip, int port); }; #endif
\ No newline at end of file |