Florent Le Coz
28d244631d
Add missing std::string_literals
2014-04-29 23:51:32 +02:00
Florent Le Coz
f6e6b8905b
Use C++14 string_literals
2014-04-29 21:50:13 +02:00
Florent Le Coz
58a2c00d44
Call on_connection_failed() when the connection fails to be established
2014-04-15 06:47:38 +02:00
Florent Le Coz
f7b75d7eb4
Remove a useless debug log line
2014-04-15 06:42:00 +02:00
Florent Le Coz
ffc820e234
Reconnected immediately to the XMPP whenever it closes the connection
2014-03-24 20:31:02 +01:00
Florent Le Coz
e196d2f1f4
Do not send data if we are connected, send it only once we actually are
2014-03-24 18:37:31 +01:00
Florent Le Coz
930696e48a
Remove useless cast
2014-03-10 00:12:42 +01:00
Florent Le Coz
601159e8e2
Fix a bus error by not going above an array boundary
2014-03-03 21:02:55 +01:00
Florent Le Coz
86d4347af8
Avoid unnecessary copies by recv()ing data directly into the expat buffer
2014-02-28 01:14:38 +01:00
Florent Le Coz
df774d45a9
Use scatter/gather io with sendmsg to avoid concataning strings all the time
2014-02-27 23:43:05 +01:00
Florent Le Coz
e2b9e80244
Fix a wrong comment
2014-02-26 01:15:44 +01:00
Florent Le Coz
541af5236e
Consider that the connect() succeded if errno EISCONN
...
Apparently on some systems, subsquent connect() calls may fail with EISCONN
error, to indicate that the connection succeded in the background, instead
of returning 0.
2014-02-22 23:36:03 +01:00
Florent Le Coz
730cc6e1bd
Save the addrinfo values for reuse on subsequent connect() call
2014-02-22 23:35:14 +01:00
Florent Le Coz
99aba5667d
Connection to servers does not block the process anymore
2014-02-22 21:42:24 +01:00
Florent Le Coz
e390b79a12
Do not receive SIGPIPE when send() is called on a closed socket
...
The error is handled using the return value
2014-02-20 00:00:05 +01:00
Florent Le Coz
16be9af3fc
Send unavailable presence to all muc when the IRC server closes the connection
2014-02-19 23:59:43 +01:00
Florent Le Coz
d46e7ee8c9
Enable TCP keepalive on sockets
2014-02-08 08:14:24 +01:00
Florent Le Coz
eb2a2e75c2
Add missing logger include
2014-02-08 08:14:08 +01:00
Florent Le Coz
da85617428
Use strerror and log_error instead of perrror
2014-02-08 07:59:02 +01:00
Florent Le Coz
c8b41d5e35
Be verbose about IRC server connection failures, and handle them properly
2014-02-08 07:52:22 +01:00
Florent Le Coz
d1c6d64546
Add missing stdexcept includes
2014-01-13 20:19:10 +01:00
Florent Le Coz
7701c90763
Add missing errno.h includes
2014-01-04 02:48:08 +01:00
Florent Le Coz
baf03a7e20
Do not throw an exception when recv returns and error, just close the socket
2014-01-04 01:59:36 +01:00
Florent Le Coz
aa53276859
Keep a "connected" state in the SocketHandler class
2014-01-04 01:59:35 +01:00
Florent Le Coz
3afb63a650
Shutdown cleanly on SIGINT
2014-01-04 01:59:14 +01:00
Florent Le Coz
983477084c
connect() returns a boolean
2013-12-24 14:03:40 +01:00
Florent Le Coz
2ecb637f0c
Read a variable number of bytes, 4096 by default
2013-12-23 17:07:43 +01:00
Florent Le Coz
a4c845ab6c
Use the logger everywhere
2013-12-03 19:15:37 +01:00
Florent Le Coz
b72908548d
Let the user choose the poller to use through cmake POLLER option
...
Use ccmake, or cmake -i, or cmake -DPOLLER=EPOLL, for example
2013-11-21 00:35:15 +01:00
Florent Le Coz
b569240a55
Use epoll
2013-11-21 00:35:15 +01:00
Florent Le Coz
6a43d350be
Add include for perror
2013-11-10 03:08:45 +01:00
Florent Le Coz
d834d6ed06
Exit the poller when it handles no connection at all
2013-11-03 17:55:23 +01:00
Florent Le Coz
358b53faef
Move the basic socket implementation into the SocketHandler class
...
(that is, the read/write/connect/etc)
Because this code is actually common for both the IrcClient and
XmppComponent class. These two classes have to implement some higher level
callbacks (parsing the data provided in the buffers, doing stuff when the
connection is done) instead of doing the read/write/connect low level
things.
2013-11-02 23:39:00 +01:00
Florent Le Coz
4027ef8c00
Basic IRC message parsing/sending
2013-11-02 16:04:10 +01:00
Florent Le Coz
7869ef2ace
First step of the connection skeleton
...
Basic connect, socket creating, polling, recving, etc.
2013-11-02 03:19:24 +01:00