aboutsummaryrefslogtreecommitdiff
path: root/src/socketengines/socketengine_select.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary prefix from socketengine source files.Gravatar Sadie Powell2021-03-051-185/+0
|
* Merge branch 'insp3' into master.Gravatar Sadie Powell2020-01-171-3/+9
|\
| * Update copyright headers.Gravatar InspIRCd Robot2020-01-111-3/+9
| |
* | Merge branch 'insp3' into master.Gravatar Sadie Powell2020-01-011-0/+6
|\|
| * Initialise Winsock from inside the socket engine.Gravatar Peter Powell2019-12-081-0/+6
| |
* | LogManager: remove fakederef.Gravatar Sadie Powell2019-02-071-2/+2
|/
* Convert GetMaxFds() to size_t and deduplicate setting code.Gravatar Peter Powell2017-10-221-3/+10
|
* Improve and centralize socket engine event counters.Gravatar Robin Burchell2017-07-111-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The write counters were close to useless because they were only incremented on a write "event" which is only triggered when writing would block. Read handling was a little more useful in that all reads must happen through the socket engine, so these were happening at the correct time, but we can clean this up by doing it in the SE itself rather than each platform port. This means that both read and write events are now easily and usefully defined as "a syscall of either read or write was attempted". We also count empty read and write events as being an event, because they still were an attempt to poll a socket in some way. This may help to identify "bad" code which is repeatedly trying to read a socket for some reason. Lastly, we check for failed read/write calls, and log them as an error event. A lot of the time, this is how sockets are determined as being disconnected (ie. at read/write time). While we're at it, split Update() in two to make the calls more self-describing. This has no real impact since only one call is made at a time anyway.
* Dispatch EventHandler events to dedicated virtual functionsGravatar Attila Molnar2015-04-121-3/+3
| | | | Remove enum EventType
* Kill needless #includes in source filesGravatar Attila Molnar2014-06-141-1/+0
|
* Merge insp20Gravatar Attila Molnar2014-04-071-1/+3
|\
| * socketengine_select Reset the values in the timeval struct on *nix before ↵Gravatar Attila Molnar2014-02-131-1/+3
| | | | | | | | select()
* | Change all socketengine methods to be staticGravatar Attila Molnar2014-02-081-27/+20
| |
* | Move socketengine stats into a new classGravatar Attila Molnar2014-02-081-3/+3
| |
* | Update SocketEngine::CurrentSetSize in AddFdRef()/DelFdRef()Gravatar Attila Molnar2014-02-081-4/+0
| |
* | Rename SocketEngine::AddFd() and DelFd() to AddFdRef() and DelFdRef()Gravatar Attila Molnar2014-02-081-2/+2
| |
* | Replace SocketEngine::GetName() with INSPIRCD_SOCKETENGINE_NAME defineGravatar Attila Molnar2014-02-081-6/+0
| |
* | Coding style changes in socketenginesGravatar Adam2014-02-041-35/+32
| |
* | New socketengine stuff:Gravatar Adam2014-02-041-17/+5
| | | | | | | | | | Use vectors that grow as necessary instead of mass allocating everything at once Rework poll engine logic to make sense
* | Merge insp20Gravatar attilamolnar2013-08-301-1/+3
|\|
| * Fix high CPU use on Windows when connecting to a serverGravatar attilamolnar2013-06-101-1/+3
| | | | | | | | | | | | When getting a write event for an EventHandler that wanted a single write only, remove it from the WriteSet (socketengine_select) Fixes #556 reported by @WindowsUser
* | Fix spacing in calls to LogManager::Log.Gravatar Peter Powell2013-05-191-2/+2
| |
* | Add LOG_ prefix to the log level enum values.Gravatar Peter Powell2013-04-121-2/+2
| |
* | Merge inspircd_{config,version}.h into a single header file.Gravatar Peter Powell2013-04-051-2/+0
|/
* Make the select() socketengine suck significantly lessGravatar Adam2012-11-091-52/+67
|
* Windows: In-depth cleanup (see details)Gravatar ChrisTX2012-10-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -Fix x64 builds for Windows. Now all configurations compile. -Remove the non-working rebase stuff. -Remove the Windows fork hack and instead use FreeConsole() to emulate the behavior. This directly allows us to compile with ASLR, which is turned on now. -Remove the old IPC mechanism for the removed GUI. This is not needed anymore as the GUI wasn't ever supported on anything newer than 1.2 -Remove the WIN32/WINDOWS macros. _WIN32 is supported on all x86-based VC++ targets, so that's what we need. -Enable optimizations for release builds. -De-duplicate printf_c(), it was previously copy-pasted into colors.h for configure -Add the VC++ specific bad files in .gitignore -Disable PID writing on Windows. This is only making sense for *nix builds. -Replace the CPU usage retrieval with an algorithm analogous to the *nix behavior. Also supports separated now/total values. (Tested with a dummy busy loop - seems working) -Removed certain unused functions and variables -Remove stdint defines from the windows wrapper -Remove CRT debug alloc. This is a bad idea as it would define a macro to replace free which breaks builds. -Re-evaluated the warnings list, commented it. -Moved inspircd_config/_version to include/ to match *nix -Removed the creation of inspircd_se_config, as it isn't used at all. -Made non-git builds show as "r0" instead of "r" (thanks to @SaberUK for pointing this out) -Fixed up m_spanningtree's project paths. Now all configurations (debug/release x86/x64) have been tested and build properly. -Moved FindDNS out of the wrapper and matched its log behavior with *nix. (It's pointless having it in the wrapper after the recent slimming down) -Replaced random/srandom wrappers with a mechanism that tries to use Windows' Random API first is no SSL module is loaded. -Removed more old junk from support for compilers older than VC++ 2010 (we don't have project files for these, so compiling them would be hard anyways) -Removed the unused ClearConsole() -Removed unused includes from the wrapper. Also, do not include psapi.h here if we don't link psapi.lib. This should be done where appropriate. -Made inet_aton an inline function for increased performance -C4800, performance warning about bool forcing, resolved at all occurrences. -C4701, uninitialized variable 'cached', resolved at all occurrences. -dlerror() was migrated out of the wrapper for more thread safety (no global buffer being shared) and increased performance. -Removed the wrong CRT debug flags. This drains a lot of performance. -Removed the clock_gettime/gettimeofday wrappers -Replaced all TCHAR/ANSI mix-ups of functions with the correct respective function. -Added a block of C4355 for < VS2012 -Update project files for c870714
* Replace copyright headers with headers granting specific authors copyrightGravatar Robby-2012-04-191-8/+15
|
* DelFd should not fail, it will leave a bad dangling pointer in that caseGravatar danieldg2010-03-021-4/+3
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12584 e03df62e-2008-0410-955e-edbf42e46eb7
* Don't send events for removed FDs when both read and write are readyGravatar danieldg2010-03-021-0/+2
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12582 e03df62e-2008-0410-955e-edbf42e46eb7
* Remove excessive gettimeofday system callsGravatar danieldg2010-01-181-0/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12293 e03df62e-2008-0410-955e-edbf42e46eb7
* ...because every now and again, i have to do a massive commit.Gravatar brain2010-01-111-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12248 e03df62e-2008-0410-955e-edbf42e46eb7
* remove a hanging #endifGravatar peavey2009-10-241-1/+0
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11971 e03df62e-2008-0410-955e-edbf42e46eb7
* Remove IOCP socket engineGravatar danieldg2009-10-241-2/+1
| | | | | | | | | | | | IOCP has been experimental since its introduction, and has not worked correctly for some time. Since we have no windows developer, remove the dead code. Most of the advantages of IOCP are not used by an ircd process regardless: we do not use threads for our client processing, and we add an extra copy operation that eliminates any gain from OS-level buffer reuse. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11970 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix noeol on socketengine_selectGravatar danieldg2009-10-141-16/+2
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11874 e03df62e-2008-0410-955e-edbf42e46eb7
* Ugly-ish hack to select SocketEngine on windows until I or someone else ↵Gravatar peavey2009-10-111-13/+4
| | | | | | finds a better way. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11835 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix some signedness.Gravatar peavey2009-10-111-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11830 e03df62e-2008-0410-955e-edbf42e46eb7
* Remove include/inspircd_se_config.h and socketengine-specific headersGravatar danieldg2009-09-301-1/+51
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11784 e03df62e-2008-0410-955e-edbf42e46eb7
* Compile fixes and message updatesGravatar danieldg2009-09-261-3/+3
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11767 e03df62e-2008-0410-955e-edbf42e46eb7
* Add FD_WANT_SINGLE_WRITE to efficiently replace FD_WANT_POLL_WRITEGravatar danieldg2009-09-261-2/+2
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11762 e03df62e-2008-0410-955e-edbf42e46eb7
* Clean up SocketEngine interface to allow edge-triggered I/O and sockets that ↵Gravatar danieldg2009-09-261-48/+29
| | | | | | do not force readability. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11760 e03df62e-2008-0410-955e-edbf42e46eb7
* Create StreamSocket for IO hooking implementationGravatar danieldg2009-09-211-9/+6
| | | | | | | | | | | | | | Fixes the SSL SendQ bug Removes duplicate code between User and BufferedSocket Simplify SSL module API Simplify EventHandler API (Readable/Writeable moved to SE) Add hook for culled objects to invoke callbacks prior to destructor Replace SocketCull with GlobalCull now that sockets can close themselves Shorten common case of user read/parse/write path: User::Write is now zero-copy up to syscall/SSL invocation User::Read has only two copy/scan passes from read() to ProcessCommand git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11752 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix invalid iterator in select socketengine, clean up its memory use a bit tooGravatar danieldg2009-09-091-14/+13
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11687 e03df62e-2008-0410-955e-edbf42e46eb7
* Update all wiki links to point to the new wiki. This was done automatically ↵Gravatar psychon2009-03-151-1/+1
| | | | | | | | | with the following command, only .Makefile.inc got some indent fixups by hand. for file in $(find -type f -and -not -path '*/.svn/*' -and -not -name '*.so') ; do sed -e 's#http://www.inspircd.org/wiki#http://wiki.inspircd.org#' -e 's#http://wiki.inspircd.org/index.php/#http://wiki.inspircd.org/#' -i $file ; done git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11223 e03df62e-2008-0410-955e-edbf42e46eb7
* Update copyrights for 2009.Gravatar w00t2009-01-021-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10932 e03df62e-2008-0410-955e-edbf42e46eb7
* Forward port r10234, thanks psychonGravatar w00t2008-08-231-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10235 e03df62e-2008-0410-955e-edbf42e46eb7
* cleanup an old unused varGravatar peavey2008-05-111-2/+0
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9703 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix obvious compile error (whoops)Gravatar brain2008-04-151-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9513 e03df62e-2008-0410-955e-edbf42e46eb7
* the select socket engine went on the assumption that a socket may remove ↵Gravatar brain2008-04-151-37/+28
| | | | | | itself from the socket engine in the middle of the loop. Cull lists did away with this late 1.0, early 1.1, so there is now no need to keep this archaic system in here and we can halve the number of loops per cycle down to half what they used to be. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9512 e03df62e-2008-0410-955e-edbf42e46eb7
* Patch from Brain: set MAX_DESCRIPTORS for all socket engines (I missed this)Gravatar w00t2008-04-071-0/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9394 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix socketengine select to work with arsey compilers that think we're using ↵Gravatar brain2008-04-031-1/+2
| | | | | | ISO C++ git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9287 e03df62e-2008-0410-955e-edbf42e46eb7