1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
14 #ifndef __INSPIRCD_H__
15 #define __INSPIRCD_H__
20 #define printf_c printf
22 #include "inspircd_win32wrapper.h"
23 /** Windows defines these already */
32 #include "inspircd_config.h"
35 #include "usermanager.h"
39 #include "socketengine.h"
40 #include "command_parse.h"
42 #include "cull_list.h"
43 #include "filelogger.h"
47 * Used to define the maximum number of parameters a command may have.
49 #define MAXPARAMETERS 127
51 /** Returned by some functions to indicate failure.
55 /** Support for librodent -
56 * see http://www.chatspike.net/index.php?z=64
58 #define ETIREDHAMSTERS EAGAIN
60 /** Template function to convert any input type to std::string
62 template<typename T> inline std::string ConvNumeric(const T &in)
64 if (in == 0) return "0";
69 *out = "0123456789"[ std::abs( (long)quotient % 10 ) ];
76 std::reverse(res,out);
80 /** Template function to convert any input type to std::string
82 inline std::string ConvToStr(const int in)
84 return ConvNumeric(in);
87 /** Template function to convert any input type to std::string
89 inline std::string ConvToStr(const long in)
91 return ConvNumeric(in);
94 /** Template function to convert any input type to std::string
96 inline std::string ConvToStr(const char* in)
101 /** Template function to convert any input type to std::string
103 inline std::string ConvToStr(const bool in)
105 return (in ? "1" : "0");
108 /** Template function to convert any input type to std::string
110 inline std::string ConvToStr(char in)
112 return std::string(in,1);
115 /** Template function to convert any input type to std::string
117 template <class T> inline std::string ConvToStr(const T &in)
119 std::stringstream tmp;
120 if (!(tmp << in)) return std::string();
124 /** Template function to convert any input type to any other type
125 * (usually an integer or numeric type)
127 template<typename T> inline long ConvToInt(const T &in)
129 std::stringstream tmp;
130 if (!(tmp << in)) return 0;
131 return atoi(tmp.str().c_str());
134 /** Template function to convert integer to char, storing result in *res and
135 * also returning the pointer to res. Based on Stuart Lowe's C/C++ Pages.
136 * @param T input value
137 * @param V result value
138 * @param R base to convert to
140 template<typename T, typename V, typename R> inline char* itoa(const T &in, V *res, R base)
142 if (base < 2 || base > 16) { *res = 0; return res; }
146 *out = "0123456789abcdef"[ std::abs( quotient % base ) ];
150 if ( in < 0 && base == 10) *out++ = '-';
151 std::reverse( res, out );
156 /** This class contains various STATS counters
157 * It is used by the InspIRCd class, which internally
158 * has an instance of it.
160 class serverstats : public classbase
163 /** Number of accepted connections
165 unsigned long statsAccept;
166 /** Number of failed accepts
168 unsigned long statsRefused;
169 /** Number of unknown commands seen
171 unsigned long statsUnknown;
172 /** Number of nickname collisions handled
174 unsigned long statsCollisions;
175 /** Number of DNS queries sent out
177 unsigned long statsDns;
178 /** Number of good DNS replies received
179 * NOTE: This may not tally to the number sent out,
180 * due to timeouts and other latency issues.
182 unsigned long statsDnsGood;
183 /** Number of bad (negative) DNS replies received
184 * NOTE: This may not tally to the number sent out,
185 * due to timeouts and other latency issues.
187 unsigned long statsDnsBad;
188 /** Number of inbound connections seen
190 unsigned long statsConnects;
191 /** Total bytes of data transmitted
194 /** Total bytes of data received
197 /** Cpu usage at last sample
200 /** Time last sample was read
203 /** The constructor initializes all the counts to zero
206 : statsAccept(0), statsRefused(0), statsUnknown(0), statsCollisions(0), statsDns(0),
207 statsDnsGood(0), statsDnsBad(0), statsConnects(0), statsSent(0.0), statsRecv(0.0)
212 /** A list of failed port bindings, used for informational purposes on startup */
213 typedef std::vector<std::pair<std::string, long> > FailedPortList;
217 DEFINE_HANDLER1(ProcessUserHandler, void, User*);
218 DEFINE_HANDLER1(IsNickHandler, bool, const char*);
219 DEFINE_HANDLER1(IsIdentHandler, bool, const char*);
220 DEFINE_HANDLER1(FindDescriptorHandler, User*, int);
221 DEFINE_HANDLER1(FloodQuitUserHandler, void, User*);
223 /* Forward declaration - required */
225 class BanCacheManager;
227 /** The main class of the irc server.
228 * This class contains instances of all the other classes
229 * in this software, with the exception of the base class,
230 * classbase. Amongst other things, it contains a ModeParser,
231 * a DNS object, a CommandParser object, and a list of active
232 * Module objects, and facilities for Module objects to
233 * interact with the core system it implements. You should
234 * NEVER attempt to instantiate a class of type InspIRCd
235 * yourself. If you do, this is equivalent to spawning a second
236 * IRC server, and could have catastrophic consequences for the
237 * program in terms of ram usage (basically, you could create
238 * an obese forkbomb built from recursively spawning irc servers!)
240 class CoreExport InspIRCd : public classbase
243 /** Holds the current UID. Used to generate the next one.
245 char current_uid[UUID_LENGTH];
247 /** Set up the signal handlers
251 /** Daemonize the ircd and close standard input/output streams
252 * @return True if the program daemonized succesfully
256 /** Iterate the list of BufferedSocket objects, removing ones which have timed out
257 * @param TIME the current time
259 void DoSocketTimeouts(time_t TIME);
261 /** Sets up UID subsystem
263 void InitialiseUID();
265 /** Perform background user events such as PING checks
267 void DoBackgroundUserStuff();
269 /** Returns true when all modules have done pre-registration checks on a user
270 * @param user The user to verify
271 * @return True if all modules have finished checking this user
273 bool AllModulesReportReady(User* user);
275 /** Logfile pathname specified on the commandline, or empty string
277 char LogFileName[MAXBUF];
279 /** The current time, updated in the mainloop
283 /** The time that was recorded last time around the mainloop
287 /** A 64k buffer used to read client lines into
289 char ReadBuffer[65535];
291 /** Used when connecting clients
293 insp_sockaddr client, server;
295 /** Used when connecting clients
299 /** Nonblocking file writer
303 /** Time offset in seconds
304 * This offset is added to all calls to Time(). Use SetTimeDelta() to update
314 /** Global cull list, will be processed on next iteration
316 CullList GlobalCulls;
320 ProcessUserHandler HandleProcessUser;
321 IsNickHandler HandleIsNick;
322 IsIdentHandler HandleIsIdent;
323 FindDescriptorHandler HandleFindDescriptor;
324 FloodQuitUserHandler HandleFloodQuitUser;
326 /** BufferedSocket classes pending deletion after being closed.
327 * We don't delete these immediately as this may cause a segmentation fault.
329 std::map<BufferedSocket*,BufferedSocket*> SocketCull;
331 /** Globally accessible fake user record. This is used to force mode changes etc across s2s, etc.. bit ugly, but.. better than how this was done in 1.1
334 * SendMode expects a User* to send the numeric replies
335 * back to, so we create it a fake user that isnt in the user
336 * hash and set its descriptor to FD_MAGIC_NUMBER so the data
337 * falls into the abyss :p
341 /** Returns the next available UID for this server.
343 std::string GetUID();
345 /** Find a user in the UUID hash
346 * @param nick The nickname to find
347 * @return A pointer to the user, or NULL if the user does not exist
349 User *FindUUID(const std::string &);
351 /** Find a user in the UUID hash
352 * @param nick The nickname to find
353 * @return A pointer to the user, or NULL if the user does not exist
355 User *FindUUID(const char *);
357 /** Build the ISUPPORT string by triggering all modules On005Numeric events
359 void BuildISupport();
361 /** Number of unregistered users online right now.
362 * (Unregistered means before USER/NICK/dns)
364 int unregistered_count;
366 /** List of server names we've seen.
368 servernamelist servernames;
370 /** Time this ircd was booted
374 /** Config file pathname specified on the commandline or via ./configure
376 char ConfigFileName[MAXBUF];
378 /** Mode handler, handles mode setting and removal
382 /** Command parser, handles client to server commands
384 CommandParser* Parser;
386 /** Socket engine, handles socket activity events
390 /** ModuleManager contains everything related to loading/unloading
393 ModuleManager* Modules;
395 /** BanCacheManager is used to speed up checking of restrictions on connection
398 BanCacheManager *BanCache;
400 /** Stats class, holds miscellaneous stats counters
404 /** Server Config class, holds configuration file data
406 ServerConfig* Config;
408 /** Snomask manager - handles routing of snomask messages
413 /** Client list, a hash_map containing all clients, local and remote
415 user_hash* clientlist;
417 /** Client list stored by UUID. Contains all clients, and is updated
418 * automatically by the constructor and destructor of User.
422 /** Channel list, a hash_map containing all channels
426 /** Local client list, a vector containing only local clients
428 std::vector<User*> local_users;
430 /** Oper list, a vector containing all local and remote opered users
432 std::list<User*> all_opers;
434 /** DNS class, provides resolver facilities to the core and modules
438 /** Timer manager class, triggers Timer timer events
440 TimerManager* Timers;
442 /** X-Line manager. Handles G/K/Q/E line setting, removal and matching
444 XLineManager* XLines;
446 /** User manager. Various methods and data associated with users.
450 /** Set to the current signal recieved
454 /** Get the current time
455 * Because this only calls time() once every time around the mainloop,
456 * it is much faster than calling time() directly.
457 * @param delta True to use the delta as an offset, false otherwise
458 * @return The current time as an epoch value (time_t)
460 time_t Time(bool delta = false);
462 /** Set the time offset in seconds
463 * This offset is added to Time() to offset the system time by the specified
465 * @param delta The number of seconds to offset
466 * @return The old time delta
468 int SetTimeDelta(int delta);
470 /** Number of users with a certain mode set on them
472 int ModeCount(const char mode);
474 /** Get the time offset in seconds
475 * @return The current time delta (in seconds)
479 /** Process a user whos socket has been flagged as active
480 * @param cu The user to process
481 * @return There is no actual return value, however upon exit, the user 'cu' may have been
482 * marked for deletion in the global CullList.
484 caller1<void, User*> ProcessUser;
486 /** Bind all ports specified in the configuration file.
487 * @param bail True if the function should bail back to the shell on failure
488 * @param found_ports The actual number of ports found in the config, as opposed to the number actually bound
489 * @return The number of ports actually bound without error
491 int BindPorts(bool bail, int &found_ports, FailedPortList &failed_ports);
493 /** Binds a socket on an already open file descriptor
494 * @param sockfd A valid file descriptor of an open socket
495 * @param port The port number to bind to
496 * @param addr The address to bind to (IP only)
497 * @return True if the port was bound successfully
499 bool BindSocket(int sockfd, int port, char* addr, bool dolisten = true);
501 /** Adds a server name to the list of servers we've seen
502 * @param The servername to add
504 void AddServerName(const std::string &servername);
506 /** Finds a cached char* pointer of a server name,
507 * This is used to optimize User by storing only the pointer to the name
508 * @param The servername to find
509 * @return A pointer to this name, gauranteed to never become invalid
511 const char* FindServerNamePtr(const std::string &servername);
513 /** Returns true if we've seen the given server name before
514 * @param The servername to find
515 * @return True if we've seen this server name before
517 bool FindServerName(const std::string &servername);
519 /** Gets the GECOS (description) field of the given server.
520 * If the servername is not that of the local server, the name
521 * is passed to handling modules which will attempt to determine
522 * the GECOS that bleongs to the given servername.
523 * @param servername The servername to find the description of
524 * @return The description of this server, or of the local server
526 std::string GetServerDescription(const char* servername);
528 /** Write text to all opers connected to this server
529 * @param text The text format string
530 * @param ... Format args
532 void WriteOpers(const char* text, ...);
534 /** Write text to all opers connected to this server
535 * @param text The text to send
537 void WriteOpers(const std::string &text);
539 /** Find a user in the nick hash.
540 * If the user cant be found in the nick hash check the uuid hash
541 * @param nick The nickname to find
542 * @return A pointer to the user, or NULL if the user does not exist
544 User* FindNick(const std::string &nick);
546 /** Find a user in the nick hash.
547 * If the user cant be found in the nick hash check the uuid hash
548 * @param nick The nickname to find
549 * @return A pointer to the user, or NULL if the user does not exist
551 User* FindNick(const char* nick);
553 /** Find a user in the nick hash ONLY
555 User* FindNickOnly(const char* nick);
557 /** Find a user in the nick hash ONLY
559 User* FindNickOnly(const std::string &nick);
561 /** Find a channel in the channels hash
562 * @param chan The channel to find
563 * @return A pointer to the channel, or NULL if the channel does not exist
565 Channel* FindChan(const std::string &chan);
567 /** Find a channel in the channels hash
568 * @param chan The channel to find
569 * @return A pointer to the channel, or NULL if the channel does not exist
571 Channel* FindChan(const char* chan);
573 /** Check for a 'die' tag in the config file, and abort if found
574 * @return Depending on the configuration, this function may never return
578 /** Check we aren't running as root, and exit if we are
579 * @return Depending on the configuration, this function may never return
583 /** Determine the right path for, and open, the logfile
584 * @param argv The argv passed to main() initially, used to calculate program path
585 * @param argc The argc passed to main() initially, used to calculate program path
586 * @return True if the log could be opened, false if otherwise
588 bool OpenLog(char** argv, int argc);
590 /** Close the currently open log file
594 /** Send a server notice to all local users
595 * @param text The text format string to send
596 * @param ... The format arguments
598 void ServerNoticeAll(char* text, ...);
600 /** Send a server message (PRIVMSG) to all local users
601 * @param text The text format string to send
602 * @param ... The format arguments
604 void ServerPrivmsgAll(char* text, ...);
606 /** Send text to all users with a specific set of modes
607 * @param modes The modes to check against, without a +, e.g. 'og'
608 * @param flags one of WM_OR or WM_AND. If you specify WM_OR, any one of the
609 * mode characters in the first parameter causes receipt of the message, and
610 * if you specify WM_OR, all the modes must be present.
611 * @param text The text format string to send
612 * @param ... The format arguments
614 void WriteMode(const char* modes, int flags, const char* text, ...);
616 /** Return true if a channel name is valid
617 * @param chname A channel name to verify
618 * @return True if the name is valid
620 bool IsChannel(const char *chname);
622 /** Rehash the local server
626 /** Handles incoming signals after being set
627 * @param signal the signal recieved
629 void SignalHandler(int signal);
631 /** Sets the signal recieved
632 * @param signal the signal recieved
634 static void SetSignal(int signal);
636 /** Causes the server to exit after unloading modules and
637 * closing all open file descriptors.
639 * @param The exit code to give to the operating system
640 * (See the ExitStatus enum for valid values)
642 void Exit(int status);
644 /** Causes the server to exit immediately with exit code 0.
645 * The status code is required for signal handlers, and ignored.
647 static void QuickExit(int status);
649 /** Return a count of users, unknown and known connections
650 * @return The number of users
654 /** Return a count of fully registered connections only
655 * @return The number of registered users
657 int RegisteredUserCount();
659 /** Return a count of opered (umode +o) users only
660 * @return The number of opers
664 /** Return a count of unregistered (before NICK/USER) users only
665 * @return The number of unregistered (unknown) connections
667 int UnregisteredUserCount();
669 /** Return a count of channels on the network
670 * @return The number of channels
674 /** Return a count of local users on this server only
675 * @return The number of local users
677 long LocalUserCount();
679 /** Send an error notice to all local users, opered and unopered
680 * @param s The error string to send
682 void SendError(const std::string &s);
684 /** Return true if a nickname is valid
685 * @param n A nickname to verify
686 * @return True if the nick is valid
688 caller1<bool, const char*> IsNick;
690 /** Return true if an ident is valid
691 * @param An ident to verify
692 * @return True if the ident is valid
694 caller1<bool, const char*> IsIdent;
696 /** Find a username by their file descriptor.
697 * It is preferred to use this over directly accessing the fd_ref_table array.
698 * @param socket The file descriptor of a user
699 * @return A pointer to the user if the user exists locally on this descriptor
701 caller1<User*, int> FindDescriptor;
703 /** Add a new mode to this server's mode parser
704 * @param mh The modehandler to add
705 * @return True if the mode handler was added
707 bool AddMode(ModeHandler* mh);
709 /** Add a new mode watcher to this server's mode parser
710 * @param mw The modewatcher to add
711 * @return True if the modewatcher was added
713 bool AddModeWatcher(ModeWatcher* mw);
715 /** Delete a mode watcher from this server's mode parser
716 * @param mw The modewatcher to delete
717 * @return True if the modewatcher was deleted
719 bool DelModeWatcher(ModeWatcher* mw);
721 /** Add a dns Resolver class to this server's active set
722 * @param r The resolver to add
723 * @param cached If this value is true, then the cache will
724 * be searched for the DNS result, immediately. If the value is
725 * false, then a request will be sent to the nameserver, and the
726 * result will not be immediately available. You should usually
727 * use the boolean value which you passed to the Resolver
728 * constructor, which Resolver will set appropriately depending
729 * on if cached results are available and haven't expired. It is
730 * however safe to force this value to false, forcing a remote DNS
731 * lookup, but not an update of the cache.
732 * @return True if the operation completed successfully. Note that
733 * if this method returns true, you should not attempt to access
734 * the resolver class you pass it after this call, as depending upon
735 * the request given, the object may be deleted!
737 bool AddResolver(Resolver* r, bool cached);
739 /** Add a command to this server's command parser
740 * @param f A Command command handler object to add
741 * @throw ModuleException Will throw ModuleExcption if the command already exists
743 void AddCommand(Command *f);
745 /** Send a modechange.
746 * The parameters provided are identical to that sent to the
747 * handler for class cmd_mode.
748 * @param parameters The mode parameters
749 * @param pcnt The number of items you have given in the first parameter
750 * @param user The user to send error messages to
752 void SendMode(const char **parameters, int pcnt, User *user);
754 /** Match two strings using pattern matching.
755 * This operates identically to the global function match(),
756 * except for that it takes std::string arguments rather than
758 * @param sliteral The literal string to match against
759 * @param spattern The pattern to match against. CIDR and globs are supported.
761 bool MatchText(const std::string &sliteral, const std::string &spattern);
763 /** Call the handler for a given command.
764 * @param commandname The command whos handler you wish to call
765 * @param parameters The mode parameters
766 * @param pcnt The number of items you have given in the first parameter
767 * @param user The user to execute the command as
768 * @return True if the command handler was called successfully
770 CmdResult CallCommandHandler(const std::string &commandname, const char** parameters, int pcnt, User* user);
772 /** Return true if the command is a module-implemented command and the given parameters are valid for it
773 * @param parameters The mode parameters
774 * @param pcnt The number of items you have given in the first parameter
775 * @param user The user to test-execute the command as
776 * @return True if the command handler is a module command, and there are enough parameters and the user has permission to the command
778 bool IsValidModuleCommand(const std::string &commandname, int pcnt, User* user);
780 /** Return true if the given parameter is a valid nick!user\@host mask
781 * @param mask A nick!user\@host masak to match against
782 * @return True i the mask is valid
784 bool IsValidMask(const std::string &mask);
786 /** Rehash the local server
790 /** Return the channel whos index number matches that provided
791 * @param The index number of the channel to fetch
792 * @return A channel record, or NUll if index < 0 or index >= InspIRCd::ChannelCount()
794 Channel* GetChannelIndex(long index);
796 /** Dump text to a user target, splitting it appropriately to fit
797 * @param User the user to dump the text to
798 * @param LinePrefix text to prefix each complete line with
799 * @param TextStream the text to send to the user
801 void DumpText(User* User, const std::string &LinePrefix, stringstream &TextStream);
803 /** Check if the given nickmask matches too many users, send errors to the given user
804 * @param nick A nickmask to match against
805 * @param user A user to send error text to
806 * @return True if the nick matches too many users
808 bool NickMatchesEveryone(const std::string &nick, User* user);
810 /** Check if the given IP mask matches too many users, send errors to the given user
811 * @param ip An ipmask to match against
812 * @param user A user to send error text to
813 * @return True if the ip matches too many users
815 bool IPMatchesEveryone(const std::string &ip, User* user);
817 /** Check if the given hostmask matches too many users, send errors to the given user
818 * @param mask A hostmask to match against
819 * @param user A user to send error text to
820 * @return True if the host matches too many users
822 bool HostMatchesEveryone(const std::string &mask, User* user);
824 /** Calculate a duration in seconds from a string in the form 1y2w3d4h6m5s
825 * @param str A string containing a time in the form 1y2w3d4h6m5s
826 * (one year, two weeks, three days, four hours, six minutes and five seconds)
827 * @return The total number of seconds
829 long Duration(const std::string &str);
831 /** Attempt to compare an oper password to a string from the config file.
832 * This will be passed to handling modules which will compare the data
833 * against possible hashed equivalents in the input string.
834 * @param data The data from the config file
835 * @param input The data input by the oper
836 * @param tagnum the tag number of the oper's tag in the config file
837 * @return 0 if the strings match, 1 or -1 if they do not
839 int OperPassCompare(const char* data,const char* input, int tagnum);
841 /** Check if a given server is a uline.
842 * An empty string returns true, this is by design.
843 * @param server The server to check for uline status
844 * @return True if the server is a uline OR the string is empty
846 bool ULine(const char* server);
848 /** Returns true if the uline is 'silent' (doesnt generate
849 * remote connect notices etc).
851 bool SilentULine(const char* server);
853 /** Returns the subversion revision ID of this ircd
854 * @return The revision ID or an empty string
856 std::string GetRevision();
858 /** Returns the full version string of this ircd
859 * @return The version string
861 std::string GetVersionString();
863 /** Attempt to write the process id to a given file
864 * @param filename The PID file to attempt to write to
865 * @return This function may bail if the file cannot be written
867 void WritePID(const std::string &filename);
869 /** This constructor initialises all the subsystems and reads the config file.
870 * @param argc The argument count passed to main()
871 * @param argv The argument list passed to main()
872 * @throw <anything> If anything is thrown from here and makes it to
873 * you, you should probably just give up and go home. Yes, really.
874 * It's that bad. Higher level classes should catch any non-fatal exceptions.
876 InspIRCd(int argc, char** argv);
878 /** Output a log message to the ircd.log file
879 * The text will only be output if the current loglevel
880 * is less than or equal to the level you provide
881 * @param level A log level from the DebugLevel enum
882 * @param text Format string of to write to the log
883 * @param ... Format arguments of text to write to the log
885 void Log(int level, const char* text, ...);
887 /** Output a log message to the ircd.log file
888 * The text will only be output if the current loglevel
889 * is less than or equal to the level you provide
890 * @param level A log level from the DebugLevel enum
891 * @param text Text to write to the log
893 void Log(int level, const std::string &text);
895 /** Send a line of WHOIS data to a user.
896 * @param user user to send the line to
897 * @param dest user being WHOISed
898 * @param numeric Numeric to send
899 * @param text Text of the numeric
901 void SendWhoisLine(User* user, User* dest, int numeric, const std::string &text);
903 /** Send a line of WHOIS data to a user.
904 * @param user user to send the line to
905 * @param dest user being WHOISed
906 * @param numeric Numeric to send
907 * @param format Format string for the numeric
908 * @param ... Parameters for the format string
910 void SendWhoisLine(User* user, User* dest, int numeric, const char* format, ...);
912 /** Quit a user for excess flood, and if they are not
913 * fully registered yet, temporarily zline their IP.
914 * @param current user to quit
916 caller1<void, User*> FloodQuitUser;
918 /** Restart the server.
919 * This function will not return. If an error occurs,
920 * it will throw an instance of CoreException.
921 * @param reason The restart reason to show to all clients
922 * @throw CoreException An instance of CoreException indicating the error from execv().
924 void Restart(const std::string &reason);
926 /** Prepare the ircd for restart or shutdown.
927 * This function unloads all modules which can be unloaded,
928 * closes all open sockets, and closes the logfile.
932 /** This copies the user and channel hash_maps into new hash maps.
933 * This frees memory used by the hash_map allocator (which it neglects
934 * to free, most of the time, using tons of ram)
936 void RehashUsersAndChans();
938 /** Resets the cached max bans value on all channels.
943 /** Return a time_t as a human-readable string.
945 std::string TimeString(time_t curtime);
947 /** Begin execution of the server.
948 * NOTE: this function NEVER returns. Internally,
949 * it will repeatedly loop.
950 * @return The return value for this function is undefined.
954 /** Force all BufferedSockets to be removed which are due to
957 void BufferedSocketCull();
959 char* GetReadBuffer()
961 return this->ReadBuffer;