-
Notifications
You must be signed in to change notification settings - Fork 725
Refine socket-api sample #1040
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
Refine socket-api sample #1040
Conversation
printf("[Server] Shuting down ... \n"); | ||
printf("[Server] Shuting down ..\n"); | ||
shutdown(socket_fd, SHUT_RDWR); | ||
close(socket_fd); |
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.
either shutdown
or close
, both are too much
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.
Done
samples/socket-api/README.md
Outdated
Start the tcp client, which connects the server and receives message. | ||
```bash | ||
cd build | ||
./iwasm --addr-pool=0.0.0.0/15 tcp_client.wasm |
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.
127.0.0.1 is better
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.
Done
samples/socket-api/README.md
Outdated
Start the tcp server, which opens port 1234 and waits for clients to connect. | ||
```bash | ||
cd build | ||
./iwasm --addr-pool=127.0.0.1/15 tcp_server.wasm |
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.
The server should use 0.0.0.0 to allow it to bind to any address. Partially because the code is use 0.0.0.0.
LGTM |
Refine the source code of tcp_server.c and tcp_client.c
Add building of iwasm with lib-pthread and libc-wasi enabled
Add sample document
Update iwasm --addr-pool argument description