-
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
socket related from network_framework_integration branch #662
base: grand_dispatch_queue
Are you sure you want to change the base?
Conversation
struct nw_socket *socket_impl = socket->impl; | ||
|
||
nw_socket->connect_args = aws_mem_calloc(socket->allocator, 1, sizeof(struct nw_socket_connect_args)); | ||
if (!nw_socket->connect_args) { |
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.
we do not need to check result of an aws_mem_calloc
nw_parameters_t socket_options_to_params; | ||
struct aws_linked_list read_queue; | ||
int last_error; | ||
aws_socket_on_readable_fn *on_readable; | ||
void *on_readable_user_data; | ||
bool setup_run; | ||
bool setup_closing; |
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.
Changing to "socket_closed". I think where this is used is not checking the transitory state of the socket but is instead simply checking whether it's open for use.
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.
On second thought, changed it to socket_open
. We can start it as false and only flip it to true on a successful socket connection, and flip it back to false on a socket closure.
@@ -73,18 +73,28 @@ enum socket_state { | |||
CLOSED, | |||
}; | |||
|
|||
struct nw_socket_connect_args { |
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.
renaming this to nw_socket_timeout_args
to better reflect what it's used for.
bool read_queued; | ||
bool is_listener; | ||
struct nw_socket_connect_args *connect_args; |
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.
renaming to timeout_args
for clarity
Apple Network Framework socket integration
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.