summaryrefslogtreecommitdiffstats
path: root/PICA_node.h
diff options
context:
space:
mode:
Diffstat (limited to 'PICA_node.h')
-rwxr-xr-xPICA_node.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/PICA_node.h b/PICA_node.h
index d0eb04b..c387dc1 100755
--- a/PICA_node.h
+++ b/PICA_node.h
@@ -17,6 +17,7 @@
#include <sys/ioctl.h>
#include <unistd.h>
#include <sys/errno.h>
+#include <sys/time.h>
#define SOCKET int
#define SOCKET_ERROR -1
@@ -65,8 +66,8 @@
#define PICA_NETWORKNAME "TESTNET" // TEMP //CONF
#define NEWCONN_BUFSIZE 10
-#define CL_RBUFSIZE 32
-#define CL_WBUFSIZE 128
+//#define CL_RBUFSIZE 32
+//#define CL_WBUFSIZE 128
#define DEFAULT_BUF_SIZE 4096
@@ -81,8 +82,10 @@ struct client *right;
SOCKET sck_comm;
struct sockaddr_in addr;
SSL *ssl_comm;
-unsigned char r_buf[CL_RBUFSIZE];
-unsigned char w_buf[CL_WBUFSIZE];
+unsigned char *r_buf;
+unsigned char *w_buf;
+unsigned int buflen_r;
+unsigned int buflen_w;
unsigned int r_pos;
unsigned int w_pos;
@@ -93,8 +96,8 @@ int state;
struct client* next;//структура client может быть одновременно в составе дерева и линейного списка
struct client* prev;
-
-
+time_t tmst;
+int disconnect_ticking;//on sending message TO client this var is set to 1, on receiving some message FROM client this var is reset to 0
};
struct cclink //структура, описывающая соединение двух клиентов между собой через сервер
@@ -102,7 +105,7 @@ struct cclink //структура, описывающая соединение
//unsigned int cclink_id;
unsigned int state;
-clock_t tmst;
+time_t tmst;
struct client *p1;//caller
struct client *p2;//callee
@@ -125,13 +128,14 @@ unsigned int bufpos_p2p1;
struct cclink *next;
struct cclink *prev;
+int disconnect_ticking;
};
struct newconn //структура, описывающая новое подключение (клиента)
{
SOCKET sck;
struct sockaddr_in addr;
-clock_t tmst;
+time_t tmst;
int pos;
unsigned char buf[NEWCONN_BUFSIZE];
};
@@ -154,6 +158,9 @@ unsigned int w_pos;
struct nodelink *next;
struct nodelink *prev;
+
+time_t tmst;
+int disconnect_ticking;
};
#endif