Eric Frias
751777e754
Fix more locations where we were making boost::asio calls with buffers declared on the stack which could cause problems when the calling tasks were canceled.
2014-09-11 16:30:03 -04:00
Eric Frias
aa6882b3b7
Allow us to safely cancel tasks that are executing asynchronous network reads
...
and writes. This was previously unsafe because we almost always passed read/write
buffers to boost that were on the stack. Canceling the task deleted the stack and
therefore the buffer, but couldn't reliably prevent boost from writing to the buffer
if data came in after the cancel. This commit adds variants of the read and write
functions that take a shared_ptr<char> instead of a raw char* as the buffer, and
these variants will ensure the shared_ptr will outlive the boost::asio read/write.
2014-09-09 11:10:37 -04:00
Eric Frias
f8472af119
Change fc::canceled_exceptions thrown due to a socket operation being canceled into regular fc::exceptions -- we're reserving canceled_exception for canceling async tasks
2014-08-28 15:34:04 -04:00
dnotestein
7cc69f3bb7
Set canceled flag in task's context object so that we cancel out of active tasks when they try to resume. Wrap a try-catch block around tcp and udp resolve requests to convert any non-fc exceptions to fc exceptions. Minor change to clarify design intent that request_time_task should always be running in _ntp_thread.
2014-08-01 11:31:36 -04:00
Eric Frias
d847f6469a
Allow us to require assigning descriptions to all async tasks to aid in debugging
2014-07-27 17:37:21 -04:00
Daniel Larimer
b93fe7a50c
commenting out elog in connection refused from fc
2014-06-17 15:43:07 -04:00
Eric Frias
2e5fdf952c
Add a new version of tcp_socket::connect_to() that allows you to set the source port
...
(working, but not yet useful because we'll need to set SO_REUSEADDR)
2014-04-02 08:54:13 -04:00
Daniel Larimer
e1e3a7361b
added flexability to json parsing and fixed closing hang in json rpc connection
2013-11-24 22:23:29 -05:00
Daniel Larimer
76b13a741a
adding missing files
2013-11-24 13:00:21 -05:00
Daniel Larimer
d9b5769c13
cleanup the asio thread gracefully on exit
2013-08-06 12:46:04 -04:00
Daniel Larimer
57e5796839
clean up exception handling on asio / sockets
2013-07-14 17:58:27 -04:00
Daniel Larimer
59a121d64b
Updating FC with changes from phoenix-int
2013-06-05 15:19:00 -04:00
Daniel Larimer
3f73d25e44
various updates
2012-10-09 21:40:29 -04:00
Daniel Larimer
40bec5e112
adding signals / asio
2012-09-09 00:25:43 -04:00