-
Notifications
You must be signed in to change notification settings - Fork 61
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
Event Loop & Socket Type Multi-Support #692
Open
xiazhvera
wants to merge
63
commits into
main
Choose a base branch
from
runtime_select_event_loop
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
9d97302
Checkpoint
bretambrose 9781845
Updated with doc comments
754c56d
Creation API
974a9b2
Checkpoint
0b7b061
Merge branch 'main' into EventLoopPublicApi
75e4f45
Formatting
4a784cc
Oops
381f3dd
Windows updates
e63c0a8
test update
09cff00
[WIP] API update for runtime switch event loop
xiazhvera ca3a134
update event loop group creation
xiazhvera 6619695
clang format
xiazhvera 7a89d9e
revert shutdown_types?
xiazhvera 56fa4d1
rename cmake flags
xiazhvera c1a4971
fix default event loop
xiazhvera 470164b
improve error message
xiazhvera 9e6d574
Update based on PR feedback:
d8f5fdd
Merge branch 'EventLoopPublicApi' of github.com:awslabs/aws-c-io into…
xiazhvera 9323cc3
Make io testing channel usable across library boundaries
b771d8c
Revert "Make io testing channel usable across library boundaries"
4f3048e
add function to override the default event loop type
xiazhvera fcb3d9a
Revert "Revert "Make io testing channel usable across library boundar…
9b16a3b
Set allocator
a30cd39
default event loop type override
xiazhvera 74733ad
hide the test help function as internal private
xiazhvera 558d179
clang format
xiazhvera 16d4e25
remove unreachable..
xiazhvera 7cb0936
update cmake for dispatch queue
xiazhvera e84a1a6
introduce socket vtable
xiazhvera d79b5b7
fix platform error code
xiazhvera 3ce216c
remove global vtable
xiazhvera 6233c9d
fix flag
xiazhvera 0f75185
set apple networkframework flag
xiazhvera f7fb5a2
prevent fail fast
xiazhvera 16861b9
update cmake event loop defines
xiazhvera 17c7cca
temporary remove dispatch queue wrap
xiazhvera d68acdb
Doc comments
bretambrose 3999196
make apple network framework public
xiazhvera 6f1984c
Merge branch 'EventLoopPublicApi' of github.com:awslabs/aws-c-io into…
xiazhvera 8d84d11
Apply suggestions from code review
xiazhvera 71fae6f
update cr changes
xiazhvera 35efc2e
Merge branch 'runtime_select_event_loop' of github.com:awslabs/aws-c-…
xiazhvera 405c988
rename enum
xiazhvera e614bdc
Merge branch 'main' of github.com:awslabs/aws-c-io into runtime_selec…
xiazhvera e22131a
Merge branch 'main' into runtime_select_event_loop
xiazhvera 51e2d5a
eliminate event loop constructor
xiazhvera 8be6cd2
clean up and format
xiazhvera ab05a35
Merge branch 'main' into runtime_select_event_loop
xiazhvera 61cbc90
lint
xiazhvera 4d0e12c
Merge branch 'runtime_select_event_loop' of github.com:awslabs/aws-c-…
xiazhvera 7b51b56
wrap the kqueue function
xiazhvera aa876a1
add posix file for non-darwin Apple platform
xiazhvera ee7fa76
fix lint
xiazhvera 2fb32ab
handling library error in cmake
xiazhvera f5a5338
Merge branch 'main' into runtime_select_event_loop
xiazhvera 7ea8588
renmae event loop new function
xiazhvera 1cbe989
update code review comments
xiazhvera 667e41a
add unit test
xiazhvera 48ad48c
move to private socket header
xiazhvera 17b79a4
move function definition
xiazhvera a32ee15
include private header & rename function
xiazhvera c53b4ad
include private socket header
xiazhvera ad5152c
format
xiazhvera File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#ifndef AWS_IO_SOCKET_IMPL_H | ||
#define AWS_IO_SOCKET_IMPL_H | ||
|
||
/** | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0. | ||
*/ | ||
|
||
#include <aws/io/io.h> | ||
#include <aws/io/socket.h> | ||
|
||
/* These are hacks for working around headers and functions we need for IO work but aren't directly includable or | ||
linkable. these are purposely not exported. These functions only get called internally. The awkward aws_ prefixes are | ||
just in case someone includes this header somewhere they were able to get these definitions included. */ | ||
#ifdef _WIN32 | ||
typedef void (*aws_ms_fn_ptr)(void); | ||
|
||
void aws_check_and_init_winsock(void); | ||
aws_ms_fn_ptr aws_winsock_get_connectex_fn(void); | ||
aws_ms_fn_ptr aws_winsock_get_acceptex_fn(void); | ||
#endif | ||
|
||
int aws_socket_init_posix( | ||
struct aws_socket *socket, | ||
struct aws_allocator *alloc, | ||
const struct aws_socket_options *options); | ||
|
||
int aws_socket_init_winsock( | ||
struct aws_socket *socket, | ||
struct aws_allocator *alloc, | ||
const struct aws_socket_options *options); | ||
|
||
int aws_socket_init_apple_nw_socket( | ||
struct aws_socket *socket, | ||
struct aws_allocator *alloc, | ||
const struct aws_socket_options *options); | ||
|
||
struct aws_socket_vtable { | ||
void (*socket_cleanup_fn)(struct aws_socket *socket); | ||
int (*socket_connect_fn)( | ||
struct aws_socket *socket, | ||
const struct aws_socket_endpoint *remote_endpoint, | ||
struct aws_event_loop *event_loop, | ||
aws_socket_on_connection_result_fn *on_connection_result, | ||
void *user_data); | ||
int (*socket_bind_fn)(struct aws_socket *socket, const struct aws_socket_endpoint *local_endpoint); | ||
int (*socket_listen_fn)(struct aws_socket *socket, int backlog_size); | ||
int (*socket_start_accept_fn)( | ||
struct aws_socket *socket, | ||
struct aws_event_loop *accept_loop, | ||
aws_socket_on_accept_result_fn *on_accept_result, | ||
void *user_data); | ||
int (*socket_stop_accept_fn)(struct aws_socket *socket); | ||
int (*socket_close_fn)(struct aws_socket *socket); | ||
int (*socket_shutdown_dir_fn)(struct aws_socket *socket, enum aws_channel_direction dir); | ||
int (*socket_set_options_fn)(struct aws_socket *socket, const struct aws_socket_options *options); | ||
int (*socket_assign_to_event_loop_fn)(struct aws_socket *socket, struct aws_event_loop *event_loop); | ||
int (*socket_subscribe_to_readable_events_fn)( | ||
struct aws_socket *socket, | ||
aws_socket_on_readable_fn *on_readable, | ||
void *user_data); | ||
int (*socket_read_fn)(struct aws_socket *socket, struct aws_byte_buf *buffer, size_t *amount_read); | ||
int (*socket_write_fn)( | ||
struct aws_socket *socket, | ||
const struct aws_byte_cursor *cursor, | ||
aws_socket_on_write_completed_fn *written_fn, | ||
void *user_data); | ||
int (*socket_get_error_fn)(struct aws_socket *socket); | ||
bool (*socket_is_open_fn)(struct aws_socket *socket); | ||
}; | ||
|
||
#endif // AWS_IO_SOCKET_IMPL_H |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Table isn't very well aligned