summaryrefslogtreecommitdiff
path: root/src/common/socket.h
diff options
context:
space:
mode:
authorTAW Dev <tawdev@taw>2009-07-08 11:04:59 -0400
committerTAW Dev <tawdev@taw>2009-07-08 11:04:59 -0400
commitaa0bb68d762f72d8abb2b71079e98a8e27969412 (patch)
tree77e38010cc0443cc7480572e823dd13ee7ee555d /src/common/socket.h
parente9c1a79b6306783d63655eca5ddbcca0b6d825d0 (diff)
parent4673fd3ca06010e74f8223486b0f34e58c7b0a7e (diff)
downloadtmwa-aa0bb68d762f72d8abb2b71079e98a8e27969412.tar.gz
tmwa-aa0bb68d762f72d8abb2b71079e98a8e27969412.tar.bz2
tmwa-aa0bb68d762f72d8abb2b71079e98a8e27969412.tar.xz
tmwa-aa0bb68d762f72d8abb2b71079e98a8e27969412.zip
Merge branch 'master' of git://gitorious.org/tmw-eathena/mainline
Diffstat (limited to 'src/common/socket.h')
-rw-r--r--src/common/socket.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/common/socket.h b/src/common/socket.h
index fe06e40..b67e660 100644
--- a/src/common/socket.h
+++ b/src/common/socket.h
@@ -12,6 +12,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
#endif
+#include <time.h>
// define declaration
@@ -44,13 +45,14 @@
#define FD_SETSIZE 4096
#endif // __INTERIX
-
/* Removed Cygwin FD_SETSIZE declarations, now are directly passed on to the compiler through Makefile [Valaris] */
// Struct declaration
struct socket_data{
int eof;
+ time_t created;
+ int connected;
unsigned char *rdata,*wdata;
int max_rdata,max_wdata;
int rdata_size,wdata_size;
@@ -71,6 +73,13 @@ struct socket_data{
#endif
+// save file descriptors for important stuff
+#define SOFT_LIMIT (FD_SETSIZE - 50)
+
+// socket timeout to establish a full connection in seconds
+#define CONNECT_TIMEOUT 15
+
+
extern struct socket_data *session[FD_SETSIZE];
extern int rfifo_size,wfifo_size;
@@ -93,4 +102,9 @@ void set_defaultparse(int (*defaultparse)(int));
int Net_Init(void);
+int fclose_(FILE *fp);
+FILE *fopen_(const char *path, const char *mode);
+
+int free_fds();
+
#endif // _SOCKET_H_