Skip to content

[wasi-sockets] Inconsistency with inherited properties #12561

@saulecabrera

Description

@saulecabrera

In the following snippet:

    let mut accept = sock.listen().unwrap();
    futures::join!(
        async {
            let next = accept.next().await.unwrap();
            assert_eq!(next.get_address_family(), sock.get_address_family());
            assert_eq!(next.get_keep_alive_enabled(), sock.get_keep_alive_enabled());
            assert_eq!(
                next.get_keep_alive_idle_time(),
                sock.get_keep_alive_idle_time()
            );
            assert_eq!(
                next.get_keep_alive_interval(),
                sock.get_keep_alive_interval()
            );
            assert_eq!(next.get_keep_alive_count(), sock.get_keep_alive_count());
            assert_eq!(next.get_hop_limit(), sock.get_hop_limit());

            // The following asserts fail. 
            assert_eq!(
                next.get_receive_buffer_size(),
                sock.get_receive_buffer_size()
            );
            assert_eq!(next.get_send_buffer_size(), sock.get_send_buffer_size());
        },
        async {
            client.connect(local_addr).await.unwrap();
        }
    );

The values for get_receive_buffer_size() and get_send_buffer_size() are different between the listener and the handler socket.

According to the spec:

The following properties are inherited from the listener socket:

  • address-family
  • keep-alive-enabled
  • keep-alive-idle-time
  • keep-alive-interval
  • keep-alive-count
  • hop-limit
  • receive-buffer-size
  • send-buffer-size

Platform specific information:

  • On ubuntu, only the comparison between get_send_buffer_size is failing.
  • On macOS, both comparisons are failing (get_receive_buffer_size / get_send_buffer_size)
  • On Windows the test behaves as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behavior in the current implementation that needs fixingwasiIssues pertaining to WASI

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions