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

socket related from network_framework_integration branch #662

Draft
wants to merge 32 commits into
base: grand_dispatch_queue
Choose a base branch
from

Conversation

sbSteveK
Copy link
Contributor

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.

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) {
Copy link
Contributor Author

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;
Copy link
Contributor Author

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.

Copy link
Contributor Author

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 {
Copy link
Contributor Author

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;
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants