38 Commits

Author SHA1 Message Date
Ozan Tezcan
d678dd2f0b
sc_sock: Add mask test (#104)
sc_sock: Add mask test
2023-05-01 22:22:48 +03:00
Sergi Vladykin
8d01854232
sc_sock: multithreaded accept (#100)
Server socket registered in multiple sc_sock_poll instances and 
multiple poller threads try to accept an incoming connection.
2022-12-07 11:14:48 +03:00
Sergi Vladykin
54984f40e1
sc_sock_poll thread safety (#99)
sc_sock_poll thread safety
2022-12-04 22:42:02 +03:00
Sergi Vladykin
611a97d9d9
Edge-Triggered mode for sc_sock (#97)
Added SC_SOCK_EDGE for edge-triggered mode
2022-09-11 04:39:54 +03:00
Ozan Tezcan
53d4a9158a
Fix compiler warnings (#95)
Fix compiler warnings
2022-08-20 18:56:21 +03:00
Sergi Vladykin
0b74cbcb2e
sc_sock: Linux to Windows cross-compilation (#88)
Fix to support build with MinGW-w64
2022-07-26 10:25:44 +03:00
Sergi Vladykin
a770ca3e5a
Function sc_sock_connect() picks wrong address faimily (#87)
Prefer same family addresses in sc_sock_connect() 

Connecting in non-blocking mode `AF_INET6` socket with `sc_sock_connect("localhost")` where both IPv4 and IPv6 addresses are assigned to "localhost" but the server listens on IPv6 only.

It fails with `Connection refused` because `getaddrinfo` looks for any available address with `AF_UNSPEC` and wrongly picks IPv4. And since it is non-blocking mode it can not retry after the failure. 

This change makes `sc_sock_connect()` give more respect to the configured socket family: the first iteration we try to connect to addresses with the matching family, the second iteration we try to connect to the rest.

Co-authored-by: Ozan Tezcan <ozantezcan@gmail.com>
2022-07-26 08:52:36 +03:00
Sergi Vladykin
871e848045
Fix error propagation (#86)
Fix error propagation for getsockopt
2022-07-25 10:20:46 +03:00
Sergi Vladykin
c87e906f9f
Fix warning for sc_sock on Windows (#83)
It should be `u_long` instead of `int` : https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-ioctlsocket
2022-06-22 09:34:50 +03:00
tezc
27a370071b cancelled setting buffer size of a socket 2021-05-13 16:54:25 +03:00
tezc
62001ca6fc sc_sock : fixed freebsd retcode 2021-04-27 20:44:34 +03:00
tezc
0f1fac7099 license change, refactor sc_sock, sc_map v2 2021-04-27 20:19:25 +03:00
tezc
3c8e0f9f70 sc_sock windows : don't try to set non-existing fds 2021-04-15 01:41:55 +03:00
tezc
c3010e0d12 do not override error message on _term family functions + clang-format 2021-04-15 01:30:58 +03:00
tezc
7af766e1d5 save error message if close on sock_poll fails 2021-04-15 00:12:09 +03:00
tezc
13a8284383 made sc_sock_poll sc_sock_pipe and cond immune to double termination 2021-04-14 23:24:43 +03:00
tezc
e1ef96ad61 made sc_sock_poll sc_sock_pipe and cond immune to double termination 2021-04-14 23:16:36 +03:00
Ozan Tezcan
e8f896f077
refactor (#67)
* refactor
2021-04-07 04:55:05 +03:00
Ozan Tezcan
c221478638
Switched to tabs for indentation, amalgamation tool works with tabs only (#66)
* Switched to tabs for indentation, amalgamation tool works with tabs only
2021-04-07 00:28:50 +03:00
Ozan Tezcan
b79c8c71a9
add systemd helper (#58)
* add systemd helper
2021-03-08 07:39:26 +03:00
tezc
10dc07669a crc32 hardware, sock startup/cleanup 2021-02-14 16:29:50 +03:00
tezc
15ca058703 XOPEN_SOURCE check 2021-02-10 21:33:03 +03:00
Tezc
488f63265a
map,sock,str tests (#33)
* map, sock tests
2021-02-08 23:01:44 +03:00
tezc
b6889914fd fix warnings 2021-02-07 22:36:57 +03:00
tezc
b51d81eb33 fix warnings 2021-02-07 22:31:04 +03:00
Tezc
166767be1e
sock, uri, sc tests (#32)
* test fix, config.h
2021-02-07 20:42:08 +03:00
Tezc
3a78b0ed2b
doc (#31) 2021-02-05 20:46:59 +03:00
Tezc
b45bd1b383
doc (#28)
* doc
2021-02-04 11:17:43 +03:00
Tezc
880290bffc
Doc (#27)
* doc
2021-02-04 02:35:34 +03:00
Tezc
e357ed8d06
doc (#26)
* doc
2021-02-03 08:09:50 +03:00
tezc
f3b3d66be0 sock-test 2021-02-01 07:11:12 +03:00
tezc
5e2d304134 fix compiler warnings 2021-01-24 18:16:48 +03:00
tezc
471b331b8d fix compiler warnings 2021-01-24 17:56:18 +03:00
tezc
20803c9a3b memory allocation config via "sc_config.h" 2021-01-23 20:57:08 +03:00
tezc
284360b8e8 rewrite buf 2021-01-14 01:44:08 +03:00
tezc
c5bf33be59 rc4 2020-12-28 11:03:24 +03:00
Tezc
ef6c1983ff
Dev (#7)
* thread & url

* fix cirrus

* fix thread

* fix thread

* split actions

* test

* fix test

* fix windows thread

* cond & fail-fast

* cond & fail-fast

* cond & fail-fast

* cond & fail-fast

* buffer

* fix swap

* fix big endian

* socket & poll

* socket fix

* kqueue fix

* freebsd

* socket & mmap init

* kqueue

* kqueue

* valgrind

* fix freebsd

* kqueue

* accept fix

* accept fix

* accept fix

* accept fix

* accept fix

* accept fix

* accept fix

* accept fix

* accept fix

* accept fix

* fix big endian fmt

* fix big endian fmt

* mmap

* mmap

* mmap

* mmap

* fix freebsd

* fix 32 bit, mmap

* fix 32 bit, mmap

* test sock

* fix 32 bit, mmap

* signal

* signal

* signal

* add test array

* fix backtrace
2020-11-29 19:37:24 +03:00
Tezc
1bde3abd9f
Portability (#5)
socket
2020-11-25 09:25:38 +03:00