Commit graph

30 commits

Author SHA1 Message Date
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
198d858d59 Wrap boost exceptions in fc exceptions for a few socket operations that can throw 2014-08-24 14:47:01 -04:00
Daniel Larimer
eed62c8338 sockets now wait for any pending write or read operations to finish before destructing 2014-07-17 17:03:25 -04:00
Eric Frias
9fa6e8a430 Separate the 'bind' operation for tcp_sockets from the 'connect_to' operation so we can tell which operation is throwing an exception in client code. convert a few boost exceptions into fc::exceptions. 2014-06-01 18:08:10 -04:00
Eric Frias
873a0ea70d Merge branch 'phoenix' into tcp_rate_limiting 2014-05-14 16:26:34 -04:00
Eric Frias
50ac462471 Enable SO_REUSEPORT on Linux as well as OS X 2014-05-14 16:02:41 -04:00
Eric Frias
eb501387e8 Set the SO_REUSEPORT flag on OS X whenever we set the SO_REUSEADDR 2014-05-13 21:14:40 -07:00
Eric Frias
bc4361bf64 Merge branch 'phoenix' into tcp_rate_limiting
Conflicts:
	include/fc/network/tcp_socket.hpp
	src/network/tcp_socket.cpp
2014-05-08 09:04:45 -04:00
Eric Frias
b8a7531eab Fix error message printed when unable to deserialize a json object, improve
logging of return values and add logging of exceptional returns from
json function calls.  Continue my endless quest to break the mac build.
2014-05-06 17:20:04 -04:00
Daniel Larimer
3ac07ddbf5 updates 2014-05-04 14:26:36 -04:00
Daniel Larimer
6532839938 fix apple build 2014-05-02 14:09:29 -04:00
Eric Frias
aa111510f3 Expose enough functions in tcp_socket and tcp_server to allow listening and originating connections on the same port. So far, this seems to work on win32, other platforms untested.
Add a local_endpoint() function so we can find out which local interface a socket is bound to
2014-05-01 14:02:49 -04:00
Eric Frias
00edd3958c Remove accidentally-committed garbage 2014-04-30 10:56:51 -04:00
Eric Frias
19f2869490 Disable keepalives on old clang compiler used for nightly
until we can upgrade it
2014-04-30 10:52:16 -04:00
Eric Frias
06df18c690 More work towards rate-limited TCP sockets 2014-04-17 19:39:15 -04:00
Eric Frias
f0633f8022 Merge branch 'phoenix' into tcp_rate_limiting 2014-04-17 16:18:22 -04:00
Eric Frias
ce7139c073 Start of work towards throttling TCP connections 2014-04-17 12:00:52 -04:00
Eric Frias
7849cc7ada Get keepalive code building on os x 2014-04-15 13:40:19 -04:00
Daniel Larimer
ac0f01843f fix build on osx by disabling some keepalive params 2014-04-11 17:06:57 -04:00
Eric Frias
85a9da6f27 Add to tcp_socket to enable TCP keepalives 2014-04-09 18:38:52 -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
a80164645f Update tcp_socket listen on single endpoint 2014-02-14 20:32:23 -05:00
Daniel Larimer
c6897c4dbf added method to get port 2013-12-22 00:10:03 -05:00
Daniel Larimer
ef2b0453cd clean up tcp_server accept api, removing unused return value 2013-08-08 15:12:01 -04:00
Daniel Larimer
f5f3bb5102 error cleanup, log cleanup, bug fixes 2013-07-18 22:19:19 -04:00
Daniel Larimer
57e5796839 clean up exception handling on asio / sockets 2013-07-14 17:58:27 -04:00
Daniel Larimer
4bfaa4b962 removing debug print statement from tcp_socket 2013-07-12 01:19:39 -04:00
Daniel Larimer
d5771acd3d added remote_endpoint() call to tcp_socket 2013-07-10 00:31:44 -04:00
Daniel Larimer
59a121d64b Updating FC with changes from phoenix-int 2013-06-05 15:19:00 -04:00