Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross platform sockets #1107

Open
wants to merge 145 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
a23975f
New socket code
stephenberry Jun 17, 2024
e358af0
updates
stephenberry Jun 17, 2024
b464a35
updates
stephenberry Jun 17, 2024
4c66bc2
Update socket_test.cpp
stephenberry Jun 17, 2024
754a15f
Update socket.hpp
stephenberry Jun 17, 2024
b44533e
updates
stephenberry Jun 17, 2024
2874347
no_delay and synchronous
stephenberry Jun 17, 2024
1e0e760
formatting
stephenberry Jun 17, 2024
bca7898
Update socket.hpp
stephenberry Jun 17, 2024
d1e1545
updates
stephenberry Jun 17, 2024
78597ba
updates
stephenberry Jun 17, 2024
080d7b9
Update socket_test.cpp
stephenberry Jun 17, 2024
2477c85
updates
stephenberry Jun 17, 2024
e60e58a
Update socket.hpp
stephenberry Jun 17, 2024
5108fba
updates
stephenberry Jun 17, 2024
50bbf64
updates
stephenberry Jun 17, 2024
0252715
updates
stephenberry Jun 17, 2024
98daed6
Update socket_test.cpp
stephenberry Jun 17, 2024
a378042
Update socket_test.cpp
stephenberry Jun 17, 2024
f306822
using size in REPE
stephenberry Jun 17, 2024
be9c4f9
updates
stephenberry Jun 17, 2024
ac2600a
multiple clients
stephenberry Jun 17, 2024
eb82b6b
thread erasing
stephenberry Jun 17, 2024
f34dd2a
Update socket_test.cpp
stephenberry Jun 17, 2024
c4c919c
disconnect
stephenberry Jun 17, 2024
2021f31
updates
stephenberry Jun 17, 2024
71cc925
Update socket.hpp
stephenberry Jun 17, 2024
7337f2e
Update socket.hpp
stephenberry Jun 17, 2024
df69e72
async_accept -> accept
stephenberry Jun 17, 2024
a18f317
Update socket.hpp
stephenberry Jun 17, 2024
279581e
Update socket.hpp
stephenberry Jun 17, 2024
8ab4709
updates
stephenberry Jun 17, 2024
d931f12
Update socket.hpp
stephenberry Jun 17, 2024
edc7f31
Added macro, INVALID_SOCKET -1 on macOS and Linux, and (~0) on Window…
Jun 18, 2024
295768a
Refactored socket error handling and message generation functions:
Jun 18, 2024
85e8b13
Added windows_socket_startup_t RAII class for Windows platform.
Jun 18, 2024
05a31db
Updated with corrections to error handling code.
Jun 20, 2024
ea228a3
Added working clients counter to inform when threads have competed work.
Jun 20, 2024
3b3e2e3
using GLZ_ for macros
stephenberry Jun 20, 2024
1d0d033
Update socket.hpp
stephenberry Jun 20, 2024
d4ed0eb
using std::latch
stephenberry Jun 20, 2024
f46aa1e
Update socket_test.cpp
stephenberry Jun 20, 2024
f959b92
fix port
stephenberry Jun 20, 2024
31fa555
Update socket.hpp
stephenberry Jun 20, 2024
3a47256
Attempt to use Xcode 15.4
stephenberry Jun 20, 2024
3e91119
cleanup
stephenberry Jun 20, 2024
e5aa968
std::latch does not work on windows, therefore working_clients counte…
Jun 20, 2024
dec888b
asynchronous accept
stephenberry Jun 20, 2024
6834d71
using polling and asynchronous sockets
stephenberry Jun 20, 2024
3f5b3e8
Update socket.hpp
stephenberry Jun 20, 2024
18c6690
Update socket.hpp
stephenberry Jun 20, 2024
ae79066
Adding windows support
stephenberry Jun 20, 2024
7db635c
Update socket.hpp
stephenberry Jun 20, 2024
a46b6f2
event_enum_failed
stephenberry Jun 20, 2024
82ffd46
client_fd
stephenberry Jun 20, 2024
402d25a
spawn_socket
stephenberry Jun 20, 2024
e697a14
more cleanup
stephenberry Jun 20, 2024
62aabb1
Missing accept_socket.socket_fd on Windows build.
Jun 20, 2024
778c9a3
Removing destructor class
stephenberry Jun 20, 2024
fe33b5a
active local to server
stephenberry Jun 20, 2024
29d432e
Update repe_test.cpp
stephenberry Jun 20, 2024
f4788a9
Update clang.yml
stephenberry Jun 20, 2024
84b1827
Update clang.yml
stephenberry Jun 20, 2024
a09e0e6
Update clang.yml
stephenberry Jun 20, 2024
2b50090
formatting
stephenberry Jun 20, 2024
8f7fd2d
Update clang.yml
stephenberry Jun 20, 2024
0ac020f
xcode 15.3
stephenberry Jun 20, 2024
0aa3698
latest-stable on macOS
stephenberry Jun 20, 2024
9583772
sleep before disconnect
stephenberry Jun 20, 2024
db2ce31
updates
stephenberry Jun 20, 2024
ff8fd9f
cleaning
stephenberry Jun 21, 2024
28e0342
cleanup
stephenberry Jun 21, 2024
5ac048c
Update socket.hpp
stephenberry Jun 21, 2024
547e976
new header and more error handling
stephenberry Jun 21, 2024
ebc637f
error handling
stephenberry Jun 21, 2024
52df8e9
Update socket.hpp
stephenberry Jun 21, 2024
54ee8b0
server_thread_cleanup
stephenberry Jun 21, 2024
12054ab
Update socket.hpp
stephenberry Jun 21, 2024
39e0cac
Update socket.hpp
stephenberry Jun 21, 2024
3cc4afa
client disconnection
stephenberry Jun 21, 2024
d4e0432
format and clang 18 fix
stephenberry Jun 21, 2024
97f7565
Free functions for send and receive
stephenberry Jun 21, 2024
493a0de
undef macros
stephenberry Jun 21, 2024
7c79cb7
reverse iterate and erase threads
stephenberry Jun 21, 2024
e557ae1
Update socket.hpp
stephenberry Jun 21, 2024
d9b2e81
Update socket.hpp
stephenberry Jun 21, 2024
d1c2b9e
using a deque for futures
stephenberry Jun 21, 2024
8e6fcaf
fix sever_thread destruction order
stephenberry Jun 21, 2024
bef970e
async_accept
stephenberry Jun 21, 2024
30f8334
Update socket.hpp
stephenberry Jun 21, 2024
2548f60
windows fix
stephenberry Jun 21, 2024
3f29343
GLZ_EWOULDBLOCK
stephenberry Jun 21, 2024
f7f43da
Update socket.hpp
stephenberry Jun 21, 2024
8c00c79
Update socket.hpp
stephenberry Jun 21, 2024
d973032
Update socket_test.cpp
stephenberry Jun 21, 2024
5567fee
Update socket.hpp
stephenberry Jun 21, 2024
7813b6b
formatting
stephenberry Jun 21, 2024
015a68e
Update socket.hpp
stephenberry Jun 21, 2024
8ed17ad
Update socket.hpp
stephenberry Jun 21, 2024
6b2c489
Update socket.hpp
stephenberry Jun 21, 2024
f249526
Update socket.hpp
stephenberry Jun 21, 2024
4ddf857
Back to std::future
stephenberry Jun 21, 2024
2ff2973
Update socket.hpp
stephenberry Jun 21, 2024
13242df
Update socket_test.cpp
stephenberry Jun 21, 2024
e06e9d8
formatting
stephenberry Jun 21, 2024
bed5b5e
Update README.md
stephenberry Jun 21, 2024
a285bc8
Update README.md
stephenberry Jun 21, 2024
55bcf20
Update socket.hpp
stephenberry Jun 21, 2024
2f7c46e
remove gcc 12 from workflow
stephenberry Jun 21, 2024
35fadde
socket -> network folder
stephenberry Jun 21, 2024
f3493ca
server.hpp
stephenberry Jun 21, 2024
4d0ebe7
cleanup
stephenberry Jun 21, 2024
10fd198
Reverting repe.hpp
stephenberry Jun 21, 2024
c64a3c0
repe_server and repe_client
stephenberry Jun 21, 2024
94b7ed9
Update socket.hpp
stephenberry Jun 21, 2024
75a3e1c
Update socket.hpp
stephenberry Jun 21, 2024
5902ff5
MSVC fix
stephenberry Jun 21, 2024
8284e7f
Fix repe_server port assignment
stephenberry Jun 21, 2024
f085f83
repe_server close client when disconnected
stephenberry Jun 21, 2024
abe983a
send/receive
stephenberry Jun 21, 2024
060a620
fixed repe_server response
stephenberry Jun 21, 2024
b2dbbb9
running 100 clients again
stephenberry Jun 21, 2024
4ddf4b3
Update repe_client.cpp
stephenberry Jun 21, 2024
152eca7
updated
stephenberry Jun 21, 2024
d0f5ca1
Update repe_server.cpp
stephenberry Jun 21, 2024
c3bfaff
Update repe_server.hpp
stephenberry Jun 21, 2024
a06c96c
Removing asio
stephenberry Jun 21, 2024
c3291c2
Merge branch 'main' into socket
stephenberry Jun 21, 2024
5c8bc51
Merge branch 'main' into socket
stephenberry Jun 24, 2024
908661b
Delete glaze_asio.hpp
stephenberry Jun 24, 2024
108ee33
Merge branch 'main' into socket
stephenberry Jun 25, 2024
b7bc4f3
socket_io.hpp
stephenberry Jun 25, 2024
892c1c5
Update socket.hpp
stephenberry Jun 25, 2024
cfc43c4
added glz::error_category
stephenberry Jun 25, 2024
7f8ebb3
add socket_io.hpp includes
stephenberry Jun 25, 2024
418abc8
Adding libfork dependency
stephenberry Jun 25, 2024
9db13bb
Revert "Adding libfork dependency"
stephenberry Jun 25, 2024
8107773
Merge branch 'main' into socket
stephenberry Jul 1, 2024
0517c7d
Added stdexec to glaze socket branch.
Jul 12, 2024
794f5d6
Started refactor of using the stdexec library.
Jul 12, 2024
2bb8572
Continued refactor using the stdexec library.
Jul 12, 2024
2ed332c
Update CMakeLists.txt
stephenberry Jul 15, 2024
b1da908
updates
stephenberry Jul 15, 2024
01be052
Merge branch 'main' into socket
stephenberry Jul 15, 2024
1bd3e0b
Update error.hpp
stephenberry Jul 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
gcc: [12, 13, 14]
gcc: [13, 14]
build_type: [Debug]
std: [23]

Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ project(

include(cmake/project-is-top-level.cmake)
include(cmake/variables.cmake)
include(cmake/stdexec.cmake)

fetch_stdexec()
add_library(glaze_glaze INTERFACE)
add_library(glaze::glaze ALIAS glaze_glaze)

Expand All @@ -19,7 +21,7 @@ if (MSVC)
string(REGEX MATCH "\/cl(.exe)?$" matched_cl ${CMAKE_CXX_COMPILER})
if (matched_cl)
# for a C++ standards compliant preprocessor, not needed for clang-cl
target_compile_options(glaze_glaze INTERFACE "/Zc:preprocessor" /permissive- /Zc:lambda)
target_compile_options(glaze_glaze INTERFACE "/Zc:preprocessor" /permissive- /Zc:lambda /Zc:__cplusplus)

if(PROJECT_IS_TOP_LEVEL)
target_compile_options(glaze_glaze INTERFACE
Expand All @@ -40,6 +42,7 @@ target_compile_features(glaze_glaze INTERFACE cxx_std_23)
target_include_directories(
glaze_glaze ${warning_guard}
INTERFACE "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${stdexec_INCLUDE_DIR}>"
)

if(NOT CMAKE_SKIP_INSTALL_RULES)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ auto ec = glz::write_file_json(obj, "./obj.json", std::string{});
- Only tested on 64bit systems, but should run on 32bit systems
- Only supports little-endian systems

[Actions](https://github.com/stephenberry/glaze/actions) build and test with [Clang](https://clang.llvm.org) (15+), [MSVC](https://visualstudio.microsoft.com/vs/features/cplusplus/) (2022), and [GCC](https://gcc.gnu.org) (12+) on apple, windows, and linux.
[Actions](https://github.com/stephenberry/glaze/actions) build and test with [Clang](https://clang.llvm.org) (15+), [MSVC](https://visualstudio.microsoft.com/vs/features/cplusplus/) (2022), and [GCC](https://gcc.gnu.org) (13+) on apple, windows, and linux.

![clang build](https://github.com/stephenberry/glaze/actions/workflows/clang.yml/badge.svg) ![gcc build](https://github.com/stephenberry/glaze/actions/workflows/gcc.yml/badge.svg) ![msvc build](https://github.com/stephenberry/glaze/actions/workflows/msvc.yml/badge.svg)

> Glaze seeks to maintain compatibility with the latest three versions of GCC and Clang, as well as the latest version of MSVC and Apple Clang.
> Glaze seeks to maintain compatibility with the latest three versions of GCC and Clang, as well as the latest version of MSVC and Apple Clang. As an exception, GCC 12 is not supported due to lack of `std::format`.

## How To Use Glaze

Expand Down
Loading
Loading