Commit Graph

53 Commits

Author SHA1 Message Date
Bartosz Taudul
3282360382 Bind on both IPv6 and IPv4 on BSD. 2019-11-21 02:03:32 +01:00
Bartosz Taudul
a9cd5b331f BSD needs netinet/in.h for struct sockaddr_in and friends. 2019-11-21 01:28:48 +01:00
Bartosz Taudul
6bbf273581 Partial header inclusion cleanup. 2019-11-05 20:09:40 +01:00
Bartosz Taudul
106411e1f6 Add missing freeaddrinfo(). 2019-10-27 13:39:01 +01:00
Bartosz Taudul
707f113bda Add missing NOMINMAX definitions. 2019-10-10 20:29:06 +02:00
Bartosz Taudul
82cd667b30 Allow specifying network port in server. 2019-09-21 15:43:01 +02:00
Bartosz Taudul
e13cbf52fd Allow changing tracy port in client. 2019-09-21 15:11:15 +02:00
Rokas Kupstys
b391e4c21a Fix multiple build errors when compiling with MinGW. 2019-08-04 15:49:46 +03:00
Bartosz Taudul
a8cb257474 Revert "Resolve client host name using DNS."
This reverts commit 48df667a37.
2019-06-26 17:58:23 +02:00
Bartosz Taudul
fadf8e3e0a Can't read negative number of bytes.
This completely ignores error handling, which probably should be added.
The code behavior doesn't change, as the existing comparisons and
asserts already promoted the signed value to unsigned.
2019-06-22 14:08:48 +02:00
Bartosz Taudul
48df667a37 Resolve client host name using DNS.
This operation is blocking and should be made asynchronous.
2019-06-21 19:27:41 +02:00
Bartosz Taudul
12e44fc605 Missing include. 2019-06-17 19:51:58 +02:00
Bartosz Taudul
e0bbb41976 Add UDP listen socket and IP address wrapper. 2019-06-17 19:23:43 +02:00
Bartosz Taudul
de058d2a0d Don't hardcode broadcast port. 2019-06-17 18:37:34 +02:00
Bartosz Taudul
40e517594b Add UDP broadcast socket. 2019-06-17 02:24:55 +02:00
Bartosz Taudul
2bc7a9bd30 Close listen socket in destructor. 2019-06-09 18:14:26 +02:00
Bartosz Taudul
82dad3fb97 Use proper type. 2019-04-01 20:43:42 +02:00
Bartosz Taudul
d0d5184c04 Set options for proper socket. 2019-04-01 20:14:00 +02:00
Bartosz Taudul
687915299a Don't try to set socket options on invalid socket. 2019-04-01 20:08:27 +02:00
Bartosz Taudul
57cd6d3ed5 Allow retrieval of socket send buffer size. 2019-04-01 18:50:37 +02:00
Bartosz Taudul
c7e64bb8a8 Replace select() with poll(). 2019-02-10 15:45:23 +01:00
Bartosz Taudul
1585be7ff3 Rearrange Socket to reduce struct size. 2019-01-29 21:56:10 +01:00
Rokas Kupstys
8157e3a0b3 Fix builds with MingW. 2019-01-19 13:53:10 +02:00
Bartosz Taudul
f55f2858c4 Raw socket read function. 2018-09-09 18:24:58 +02:00
Bartosz Taudul
8b3895473d Gag inconsequential MSVC warnings in TracySocket.
Fix your API!
2018-08-22 16:29:15 +02:00
Bartosz Taudul
716166bc3a Expose InitWinSock(). 2018-08-19 18:15:46 +02:00
Till Rathmann
3b302315f9 Fixed __ANDROID_API__ < 21 build and FD_SET usage. 2018-08-01 19:18:40 +02:00
Till Rathmann
37d5736bf5 Fixed compiler warnings. 2018-08-01 14:07:30 +02:00
Bartosz Taudul
3799e0da43 Infer socket readiness from select() return value. 2018-07-16 01:50:21 +02:00
Bartosz Taudul
efdb3791e9 Take recv buffer into account in HasData(). 2018-07-15 19:52:22 +02:00
Bartosz Taudul
ea4470b26e Buffer data from recv() calls.
This reduces cost of socket reads measured in a test run from 47ms to
8.7ms.
2018-07-15 19:34:47 +02:00
Bartosz Taudul
eeeff40a70 Prevent TIME-WAIT connections from blocking listen address.
Of course Windows has to be retarded in its own special way and implement
SO_REUSEADDR with a completely different meaning.

http://www.andy-pearce.com/blog/posts/2013/Feb/so_reuseaddr-on-windows/
2018-04-27 19:18:09 +02:00
Bartosz Taudul
347c74cec3 Cosmetics. 2018-03-31 01:06:35 +02:00
Bartosz Szreder
9e3f18a62a Split data handling code from the view. 2018-02-21 16:41:37 +01:00
Bartosz Taudul
3dc7d04ab4 Properly handle connection reset on win32. 2017-11-04 17:19:28 +01:00
Bartosz Taudul
a2f9dc75c7 Set SO_NOSIGPIPE on proper socket. 2017-11-03 11:20:39 +01:00
Bartosz Taudul
c7cb89307f Use proper __APPLE__ macro. 2017-11-03 11:09:31 +01:00
Bartosz Taudul
e31f8c2aed No sigpipe on think different. 2017-11-02 11:37:10 +01:00
Bartosz Taudul
af39dd4921 Always define noop MSG_NOSIGNAL, if not available in headers. 2017-11-02 11:31:54 +01:00
Bartosz Taudul
51013dc0e6 Manual allocation of socket memory. 2017-10-18 19:50:28 +02:00
Bartosz Taudul
31fc2335dd Silence some type mismatch warnings. 2017-10-16 21:17:58 +02:00
Bartosz Taudul
75457c1465 Remove +x flag from files. 2017-10-10 21:56:15 +02:00
Bartosz Taudul
c0b1846a35 IPV6_V6ONLY needs to be disabled on cygwin too. 2017-09-23 20:20:41 +02:00
Bartosz Taudul
5919f5f5e8 No signals on sockets. 2017-09-22 20:02:15 +02:00
Bartosz Taudul
4ce7f77cd9 Static initialization order is implementation specific. 2017-09-18 18:55:25 +02:00
Bartosz Taudul
0a7d413e83 select() may update timeval. 2017-09-15 22:44:50 +02:00
Bartosz Taudul
f29669152e Handle closed socket on win32. 2017-09-15 21:43:57 +02:00
Bartosz Taudul
ef7dca9073 Init winsock at application init, not on first socket use. 2017-09-14 02:13:45 +02:00
Bartosz Taudul
b1fcf88cf4 Implement checking if there's data to read on the socket. 2017-09-14 01:14:40 +02:00
Bartosz Taudul
037a4d7fac Handle connection closed/no data in Socket::Read(). 2017-09-13 23:27:17 +02:00