98 Commits

Author SHA1 Message Date
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
danieldg
800f02e759 Get rid of socklen_t parameter to Bind, we are using C++ here and can do it other ways
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12129 e03df62e-2008-0410-955e-edbf42e46eb7
2009-11-13 20:23:11 +00:00
danieldg
eaace5ed7c Remove Extensible parent from EventHandler
This also fixes SSL certificate support when m_sslinfo is not loaded

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12048 e03df62e-2008-0410-955e-edbf42e46eb7
2009-11-06 22:37:52 +00:00
danieldg
6fe52cbb3b Fixes found by removing User inheritance from StreamSocket
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11975 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-25 15:21:45 +00:00
danieldg
9c67795e73 Get rid of OpenTCPSocket
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11969 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-24 20:04:15 +00:00
danieldg
7aa5e059a8 Remove include/inspircd_se_config.h and socketengine-specific headers
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11784 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-30 18:31:05 +00:00
danieldg
810c662c9b Add FD_WANT_SINGLE_WRITE to efficiently replace FD_WANT_POLL_WRITE
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11762 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-26 14:12:45 +00:00
danieldg
939cb0ba98 Clean up SocketEngine interface to allow edge-triggered I/O and sockets that do not force readability.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11760 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-26 01:43:09 +00:00
danieldg
e2af2347fc Create StreamSocket for IO hooking implementation
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
2009-09-21 13:26:31 +00:00
danieldg
b31f343eac Remove unneeded Extensible inheritance and remove "age" field from classbase
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11611 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-02 00:46:11 +00:00
psychon
b6dbd6caab Update all wiki links to point to the new wiki. This was done automatically 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
2009-03-15 12:42:35 +00:00
w00t
43847ec9c7 Update copyrights for 2009.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10932 e03df62e-2008-0410-955e-edbf42e46eb7
2009-01-02 18:16:05 +00:00
w00t
efee3a4d4e Initialising the member we added might be an idea.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10456 e03df62e-2008-0410-955e-edbf42e46eb7
2008-09-07 19:50:00 +00:00
w00t
3092a8ed89 Fix forward-declaration caused as a result of recent changes.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10448 e03df62e-2008-0410-955e-edbf42e46eb7
2008-09-07 18:31:23 +00:00
w00t
61fed23a3e Start moving IO hooking from being bufferedsocket based to residing in EventHandler, this will pave the way for a generic listener type, and also simplifies a lot of code.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10447 e03df62e-2008-0410-955e-edbf42e46eb7
2008-09-07 18:31:21 +00:00