Skip to content

Conversation

@cimacmillan
Copy link
Contributor

Added a couple of socket option examples that can be used with WAMR.

Extended the sockopts example so that you can specify a specific example, rather than many other example executables. Added two more examples:

  • timeout - Sets the send recv timeout of a socket
  • multicast - Receiving multicast datagrams on a WAMR client

@cimacmillan cimacmillan changed the base branch from dev/socket to main October 3, 2022 13:12
sleep(10);

printf("Shuting down\n");
shutdown(client_socket_fd, SHUT_RDWR);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also close(client_socket_fd), the static analysis tool Coverity reports that not all resources are destroyed if close isn't called.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 does WAMR have a Coverity project setup / is it supposed to run as part of the github checks? Not sure why, but this commit didn't trigger any checks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK this is not ran as part of CI because it takes a long time (see conversation in #1529), but I think it'd be good to at least have instructions how to run it manually.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to run this manually before publishing a PR. @wenyongh Maybe it's something that can be included as part of a contributor guide readme?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cimacmillan The Coverity server is setup internally, we need to apply the privileges to access it, don't known how to make it available for the Github developers or CI to run, we will investigate more.

@wenyongh
Copy link
Collaborator

wenyongh commented Oct 6, 2022

LGTM

@wenyongh wenyongh merged commit 5ddc335 into bytecodealliance:main Oct 7, 2022
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…tecodealliance#1519)

Add a couple of socket examples that can be used with WAMR:
- The `timeout_client` and `timeout_server` examples demonstrate socket
  send and receive timeouts using the socket options
- The `multicast_client` and `multicast_server` examples demonstrate receiving
  multicast packets in WASM

And add several macro controls for `socket_opts` example.
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.

3 participants