Commit Graph

8 Commits

Author SHA1 Message Date
Wenyong Huang
ace05b182d
Fix possible non null-terminated string issue in socket sample (#1612) 2022-10-17 22:45:10 +08:00
Callum Macmillan
5ddc335a7f
Add timeout send/recv and multicast client/server socket examples (#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.
2022-10-07 10:31:21 +08:00
liang.he
1effda4cb5
Fix isssues detected by coverity (#1529)
Add return value checks
Append string terminator
2022-09-29 13:28:18 +08:00
Wenyong Huang
78b5c5b484
Merge dev/socket into main (#1393)
Implement more socket APIs, refer to #1336 and below PRs:
- Implement wasi_addr_resolve function (#1319)
- Fix socket-api byte order issue when host/network order are the same (#1327)
- Enhance sock_addr_local syscall (#1320)
- Implement sock_addr_remote syscall (#1360)
- Add support for IPv6 in WAMR (#1411)
- Implement ns lookup allowlist (#1420)
- Implement sock_send_to and sock_recv_from system calls (#1457)
- Added http downloader and multicast socket options (#1467)
- Fix `bind()` calls to receive the correct size of `sockaddr` structure (#1490)
- Assert on correct parameters (#1505)
- Copy only received bytes from socket recv buffer into the app buffer (#1497)

Co-authored-by: Marcin Kolny <mkolny@amazon.com>
Co-authored-by: Marcin Kolny <marcin.kolny@gmail.com>
Co-authored-by: Callum Macmillan <callumimacmillan@gmail.com>
2022-09-22 21:46:14 +08:00
Wenyong Huang
a517bb249a
Fix socket sample issue reported by coverity (#1397) 2022-08-19 18:06:26 +08:00
liang.he
ceaf7dc660
Fix invalid calculation of total size of bytes to send and recv (#1162)
The total size of bytes to send and recv should be set to 0 before calculation,
but not including the size of iovec_app_t structure.
2022-05-10 10:43:34 +08:00
liang.he
559a0502f1
Enable socket-api recvmsg() and sendmsg() (#1042)
Implement socket-api `recvmsg()` and `sendmsg()` for wasm app,
add sample and update document.
2022-03-30 15:57:40 +08:00
Wenyong Huang
9c87a1ee17
Implement part of Berkeley Socket API for libc-wasi (#1036)
Refer to [Networking API design](https://github.com/WebAssembly/WASI/issues/370)
and [feat(socket): berkeley socket API v2](https://github.com/WebAssembly/WASI/pull/459):

- Support the socket API of synchronous mode, including `socket/bind/listen/accept/send/recv/close/shutdown`,
    the asynchronous mode isn't supported yet.
- Support adding `--addr-pool=<pool1,pool2,..>` argument for command line to identify the valid ip address range
- Add socket-api sample and update the document
2022-03-10 15:13:38 +08:00