Commit graph

62 commits

Author SHA1 Message Date
Erik Ogenvik
dd352ec759 Refactor ai client to use op dispatch. 2015-05-24 11:25:08 +02:00
Erik Ogenvik
85193b4991 Clarify that the second argument is microseconds. 2014-10-01 22:48:22 +02:00
Erik Ogenvik
efaadab385 Fixed issue with polling.
There was an issue where the polling loop would be called continously,
resulting in 100% cpu usage.
2014-10-01 22:42:19 +02:00
Erik Ogenvik
61cc42e98c Detect disconnects and shut down connection. 2014-09-10 19:59:08 +02:00
Erik Ogenvik
6aa36e6bc2 Fixed incorrect time calculation.
When using posix_time with boost::asio one can't use local_time
directly.
2014-03-05 18:47:10 +01:00
Erik Ogenvik
850fb9247b Use more canonical way to prevent io_server stops. 2014-02-08 13:53:56 +01:00
Erik Ogenvik
c3e2487979 Support boost 1.46.
io_service::stopped() isn't available in this version.
2014-02-07 16:11:42 +01:00
Erik Ogenvik
a0ab8aa59d Reset the io_service if it's stopped after run_one. 2014-02-07 16:07:55 +01:00
Erik Ogenvik
6caffb14de Handle interleaved writes.
Since the streambuf instance will be invalidated by anything written to
it while it's being sent using an async call we need to use multiple
streambuf instances.
2014-02-06 13:38:32 +01:00
Erik Ogenvik
6e53159d71 Properly separate write and read buffers. 2014-02-04 22:24:27 +01:00
Erik Ogenvik
19fbeb26aa Check socket existence when polling. 2014-02-04 12:25:18 +01:00
Erik Ogenvik
642faeeb28 Adapt to boost 1.46.
Since we're targetting the latest LTS release of Ubuntu as a nice
baseline, and that currently only supports 1.46, we need to remove the
nice steady_timer code. For now.

This commit should probably be reverted once a newer version of Ubuntu
LTS is available.
2014-02-04 12:25:18 +01:00
Erik Ogenvik
3b7a3a44a6 Remove references to skstream. 2014-02-02 22:04:10 +01:00
Erik Ogenvik
826288c4fc Use boost::asio in clients. 2014-02-02 22:04:10 +01:00
Erik Ogenvik
b95d526eb8 Added ability to poll until a task is complete. 2013-11-13 16:13:11 +01:00
Olek Wojnar
7f9ff2246d Remove CVS $Id tags
The legacy tags are causing build issues in Debian.
2013-07-15 20:31:59 +02:00
Alistair Riddoch
72ecfcc6e7 Stop using socket linger everywhere
This didn't do what I thought. Reading this article revealed the details:
http://blog.netherlabs.nl/articles/2009/01/18/the-ultimate-so_linger-page-or-why-is-my-tcp-not-reliable
Ensuring sockets were fully transmitted is better achieved by shutting down
the write half after writing, then waiting for the far end to get a HUP.
The key test is that http is now working really reliably, where it wasn't
before, with or without linger.
2012-07-27 12:40:17 +01:00
Alistair Riddoch
76c5247f51 Add a clean disconnect method 2012-07-27 09:29:51 +01:00
Alistair Riddoch
d2f2ec1906 Add a common function for outputing arguments 2012-06-09 15:51:58 -07:00
Alistair Riddoch
83141a5490 Fix members to have indicative prefix 2012-05-31 15:25:54 +01:00
Alistair Riddoch
6525a8a1a9 Fix storing account ID
This was a regression brought in when loginSuccess was added
2012-05-31 12:15:47 +01:00
Alistair Riddoch
aec9699d95 Move the context stuff completely out of the base
This stuff is going to be way more useful if it has a bunch of cycmd
specific functionality, so putting it in the base is a bad idea
and overcomplicates it
2012-05-30 10:06:34 +01:00
Alistair Riddoch
a0bbaadbdf Move context processing out of the base class 2012-05-30 09:56:30 +01:00
Alistair Riddoch
6ce391cd73 Move account context creation out of base
Want to keep this base class a bit cleaner
2012-05-30 09:49:15 +01:00
Alistair Riddoch
da4b8871c5 Remove a pointless abstraction method for unix auth 2012-05-29 18:21:28 +01:00
Alistair Riddoch
b32bf31bc9 Simplify some checks, and assert others 2012-05-29 18:18:36 +01:00
Alistair Riddoch
bb79205888 Move low level unix socket code into util function 2012-05-29 18:10:12 +01:00
Alistair Riddoch
992e4f8e32 Parameterize linger time 2012-05-29 12:57:03 +01:00
Alistair Riddoch
ef21a4f6e7 Move socket linger call into util function 2012-05-29 12:51:23 +01:00
Alistair Riddoch
6490853e10 Remove duplicate code for Atlas output 2012-05-29 12:29:29 +01:00
Alistair Riddoch
a43b59fabd Begin adding context infrastructure 2012-05-24 11:36:19 +01:00
Alistair Riddoch
4ec82ddd37 Move login response duplicated code into a function 2012-05-24 11:07:22 +01:00
Alistair Riddoch
7c062fe9af Remove unnecessary conditionals 2012-05-14 13:04:35 +01:00
Alistair Riddoch
d930244339 Add control of spacing for output 2012-01-11 19:03:56 +00:00
Alistair Riddoch
63572c753e Prevent a conflict between autoconf defines and windows system headers. 2010-07-10 00:06:00 +01:00
Alistair Riddoch
526a6d7045 Fix a data check. 2009-12-27 10:40:34 +00:00
Alistair Riddoch
7dab79f80d Track the update IDs of entities after they are restored. 2009-12-26 22:24:02 +00:00
Alistair Riddoch
5d8d1dc234 If a ClientTask marks itself complete on setup, abort it. 2009-12-21 22:06:49 +00:00
Alistair Riddoch
4bdfe39d54 Use flags correctly to detect errors. 2009-12-07 03:57:49 +00:00
Alistair Riddoch
7f1d35ec26 Expand arguments to allow accounts of any type to be created. 2009-12-03 19:03:59 +00:00
Alistair Riddoch
253abd1835 Use SO_PEERCRED where available to avoid the need to send a message. 2009-12-01 15:37:55 +00:00
Al Riddoch
19d2719c09 Implement OSX version of Unix socket credentials check. 2009-11-30 21:28:10 +00:00
Alistair Riddoch
86ffe3ab64 Put conditionals around the code for unix socket authentication for portability 2009-11-29 20:51:02 +00:00
alriddoch
261d2f3bbd Add a header required by more recent compilers. 2009-11-29 20:40:50 +00:00
Alistair Riddoch
2007e81e3b Move the task functionality into the base class. 2009-11-28 18:31:28 +00:00
Alistair Riddoch
8f1107f949 Put a much more generic op dispatch layer in the base class. 2009-11-28 18:14:49 +00:00
Alistair Riddoch
b57fa8d4d6 More functionality in the base class. 2009-11-28 16:07:07 +00:00
Alistair Riddoch
0d5d979aa2 Move login and avatar creation mostly into base class, with reliable serialnos 2009-11-28 15:11:44 +00:00
Alistair Riddoch
48aebde6c9 Move serialno management into the base class. 2009-11-28 13:38:28 +00:00
Alistair Riddoch
2c3d176e17 Move generic op handling, and error op handling into the base class. 2009-11-27 15:09:44 +00:00