summaryrefslogtreecommitdiffstats
path: root/src/client/user.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/user.hpp')
-rw-r--r--src/client/user.hpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/client/user.hpp b/src/client/user.hpp
index 45fb5e3..03afb87 100644
--- a/src/client/user.hpp
+++ b/src/client/user.hpp
@@ -2,21 +2,22 @@
#define USER_H
#include "clui.hpp"
+#include "../const_vars.hpp"
-const int max_line_length = 156;
+const int maxlen_inbuf = max_line_len + max_name_len + 1;
+const int maxlen_outbuf = max_line_len + 1;
class Client {
int fd;
- char in_buffer[max_line_length]; // мы готовим к отправке
+ char in_buffer[maxlen_inbuf]; // for input
int in_buf_used;
- char out_buffer[max_line_length]; // нам пришло
- int out_buf_used;
+ char out_buffer[maxlen_outbuf]; // for message
bool exit_flag;
Client(int i_fd)
- : fd(i_fd), in_buf_used(0), out_buf_used(0) { }
+ : fd(i_fd), in_buf_used(0) { }
public:
~Client() { close(fd); }
@@ -27,8 +28,6 @@ public:
void AddCharToBuffer(char ch);
void RemoveCharFromBuffer();
void SendMessage();
-
- int getFd() const { return fd; } // not used
};
#endif \ No newline at end of file