112 Commits

Author SHA1 Message Date
Sadie Powell
e76b208ce8 Merge branch 'insp3' into master. 2021-03-05 09:54:26 +00:00
Sadie Powell
2ba32afa9a Fix a bunch of really obvious unnecessary includes. 2021-03-05 09:17:13 +00:00
Sadie Powell
1e1cf527d2 Merge branch 'insp3' into master. 2021-03-05 02:32:35 +00:00
InspIRCd Robot
7b1ab06a95 Update copyright headers. 2021-03-05 02:16:11 +00:00
Sadie Powell
4e488cb54d Refactor classbase/CullResult into Cullable/Cullable::Result. 2021-03-02 05:56:56 +00:00
Sadie Powell
579a17df38 Clean up a bunch of contructors and destructors. 2020-11-01 02:22:41 +00:00
Sadie Powell
b755d2a778 Merge branch 'insp3' into master. 2020-05-05 22:03:14 +01:00
InspIRCd Robot
44489ddf7e Update copyright headers. 2020-04-24 10:23:47 +01:00
InspIRCd Robot
4f9abe96a4 Fixes by misspell-fixer 2020-04-21 00:52:12 -06:00
Sadie Powell
7bdd72f634 Merge branch 'insp3' into master. 2020-02-19 01:29:45 +00:00
Sadie Powell
24f1224f77 Add HasFd to EventHandler and switch code to use it. 2020-02-15 06:25:12 +00:00
Sadie Powell
98e4ddfb21 Use C++11 inline initialisation for class members. 2020-02-06 11:25:42 +00:00
InspIRCd Robot
aa692dc103 Update copyright headers. 2020-01-11 22:14:43 +00:00
Peter Powell
5f387071d3 Add a method for swapping user I/O handlers. 2019-07-21 16:57:19 +01:00
Peter Powell
1a157c1e5c Resize the event sets to 2x the CurrentSetSize in ResizeDouble(). 2019-05-14 16:28:11 +01:00
Peter Powell
b7ecd18b73 Pass an irc::socket::sockaddrs to SocketEngine::SendTo(). 2018-01-20 12:24:35 +00:00
Peter Powell
b18e6b5556 Pass an irc::socket::sockaddrs to SocketEngine::Connect(). 2018-01-20 12:08:09 +00:00
Peter Powell
63e300ed08 Deduplicate error handling in the socket engines. 2017-10-22 19:45:05 +01:00
Peter Powell
b109871277 Convert GetMaxFds() to size_t and deduplicate setting code. 2017-10-22 19:44:45 +01:00
Peter Powell
2e331b313f Remove some outdated documentation from the SocketEngine class. 2017-08-26 16:07:52 +01:00
Peter Powell
a62ae50007 Fix a bunch of Doxygen warnings. 2017-08-26 09:58:15 +01:00
Robin Burchell
8e8b0719bf Improve and centralize socket engine event counters.
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.
2017-07-11 14:22:02 +02:00
Attila Molnar
96642de3b2 Update description of class EventHandler
Readable() and Writeable() was removed long ago
2016-08-11 11:23:38 +02:00
Attila Molnar
c6ebf05e02 Replace HandleEvent() references in the SocketEngine documentation with OnEventHandler*() 2016-08-11 11:19:28 +02:00
Attila Molnar
612384b3d4 Dispatch EventHandler events to dedicated virtual functions
Remove enum EventType
2015-04-12 16:20:13 +02:00
Attila Molnar
e0e1becc2f Add SocketEngine::WriteV() 2015-03-04 20:18:37 +01:00
Attila Molnar
5a6fd54f8f Change the number reported by SocketEngine::GetMaxFds() to be informal
Do not exit if we can't determine it
2014-06-07 13:47:26 +02:00
Attila Molnar
4ec65c6231 Call DelFd() and SetFd(-1) from SocketEngine::Close(EventHandler*) 2014-02-09 17:17:04 +01:00
Attila Molnar
efe77ba63b Change all socketengine methods to be static 2014-02-08 23:01:44 +01:00
Attila Molnar
689996cb88 Move socketengine stats into a new class 2014-02-08 22:40:30 +01:00
Attila Molnar
b01820c079 Rename SocketEngine::AddFd() and DelFd() to AddFdRef() and DelFdRef() 2014-02-08 22:25:06 +01:00
Attila Molnar
ed6176383e Replace SocketEngine::GetName() with INSPIRCD_SOCKETENGINE_NAME define 2014-02-08 13:16:31 +01:00
Attila Molnar
2cf4b614e6 Change SocketEngine functions that do not require an instance to be static 2014-02-08 13:10:09 +01:00
Adam
3752b3f59d New socketengine stuff:
Use vectors that grow as necessary instead of mass allocating everything at once
Rework poll engine logic to make sense
2014-02-04 22:39:12 +01:00
Attila Molnar
d7164e521b Change type of SocketEngine::CurrentSetSize to size_t from int 2014-02-04 21:10:45 +01:00
attilamolnar
1031f33333 Merge insp20 2013-08-30 13:01:10 +02:00
Adam
6e0b904d34 Use the correct socket related error messages on Windows 2013-07-14 20:23:53 +02:00
attilamolnar
8790551dc1 Merge insp20 2013-04-28 00:32:14 +02:00
attilamolnar
2bb64c5dcf Move SocketEngine::IgnoreError() code into socketengine.h and add test for EWOULDBLOCK 2013-04-24 19:54:58 +02:00
Adam
47332d6e9b Fix m_ssl_gnutls and perhaps some other things on Windows by recognizing WSAEWOULDBLOCK 2013-04-16 18:19:42 -05:00
Peter Powell
11cafc12d5 Tidy up source files:
- Use #pragma once instead of include guards.
- Move header files in src/modules to include/modules.
- Fixed various spacing issues.
2013-04-12 17:03:05 +01:00
Peter Powell
362f3009ac Merge inspircd_{config,version}.h into a single header file. 2013-04-05 16:39:40 +01:00
attilamolnar
26e7bb0b9a Whitespace and empty destructor removal, minor coding style changes 2013-04-01 21:56:13 +02:00
Peter Powell
808a0a0957 Fix Doxygen syntax errors. 2012-07-05 21:00:35 +01:00
Robby-
46a3904619 Replace copyright headers with headers granting specific authors copyright 2012-04-19 20:58:29 +02:00
Justin Crawford
9ebd9cba72 Fix some of the include guard names (requested by SaberUK) 2012-04-14 23:33:20 -07:00
Justin Crawford
df5f76832e Fixes for bug #12 2012-04-14 18:03:25 -07:00
danieldg
a018f26edd DelFd should not fail, it will leave a bad dangling pointer in that case
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12584 e03df62e-2008-0410-955e-edbf42e46eb7
2010-03-02 03:17:04 +00:00
danieldg
f5d5cee19a Floating-point math should have no place in an ircd
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12442 e03df62e-2008-0410-955e-edbf42e46eb7
2010-02-12 17:06:45 +00:00
brain
cd712c40e1 ...because every now and again, i have to do a massive commit.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12248 e03df62e-2008-0410-955e-edbf42e46eb7
2010-01-11 03:07:32 +00:00