summaryrefslogtreecommitdiff
path: root/src/common/socket.h
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-05-09 03:18:16 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-05-09 03:18:16 +0000
commit290fb53feea76f9749e4630ec71552e41afa59de (patch)
tree9caf07f59c86716b5f4105d22b3cb65e89386cf2 /src/common/socket.h
parent89b8b179b6864e5ce5d8b22a52feac761f66e77c (diff)
downloadhercules-290fb53feea76f9749e4630ec71552e41afa59de.tar.gz
hercules-290fb53feea76f9749e4630ec71552e41afa59de.tar.bz2
hercules-290fb53feea76f9749e4630ec71552e41afa59de.tar.xz
hercules-290fb53feea76f9749e4630ec71552e41afa59de.zip
* Added Buuyo-Tama's shortlist for send/eof sockets (defined out for now).
* Replaced toupper/tolower in ladmin by TOUPPER/TOLOWER defines. Shortlist: It's a list of sockets that have data to send and/or are ready for eof processing. It aims to reduce the amount of time spent on do_sendrecv, where it was spending ~13.5% of execution time on a server with 1k users at WoE. thanks to Buuyo-tama for the profile info and code git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10506 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/socket.h')
-rw-r--r--src/common/socket.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/common/socket.h b/src/common/socket.h
index 3d860e166..a040772a9 100644
--- a/src/common/socket.h
+++ b/src/common/socket.h
@@ -140,4 +140,26 @@ int socket_getips(uint32* ips, int max);
extern uint32 addr_[16]; // ip addresses of local host (host byte order)
extern int naddr_; // # of ip addresses
+void set_eof(int fd);
+
+/// Use a shortlist of sockets instead of iterating all sessions for sockets
+/// that have data to send or need eof processing.
+///
+/// @author Buuyo-tama
+//#define SEND_SHORTLIST
+
+#ifdef SEND_SHORTLIST
+struct send_shortlist_node {
+ struct send_shortlist_node *next; // Next node in the linked list
+ struct send_shortlist_node *prev; // Previous node in the linked list
+ int fd; // FD that needs sending.
+};
+
+// Add a fd to the shortlist so that it'll be recognized as a fd that needs
+// sending done on it.
+void send_shortlist_add_fd(int fd);
+// Do pending network sends (and eof handling) from the shortlist.
+void send_shortlist_do_sends();
+#endif
+
#endif /* _SOCKET_H_ */