Skip to content

Incorrect maximum length of the datagram #31733

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

Closed
ngolovleva opened this issue Dec 29, 2017 · 2 comments
Closed

Incorrect maximum length of the datagram #31733

ngolovleva opened this issue Dec 29, 2017 · 2 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. gardening library-io

Comments

@ngolovleva
Copy link

ngolovleva commented Dec 29, 2017

According to RawDatagramSocket.receive()

The maximum length of the datagram that can be received is 65503 bytes.

However, the test below demonstrates receiving the datagram of 65507 bytes length.

65507

import "dart:async";
import "dart:io";

int sentLength = 65507;

main() {
  var address = InternetAddress.LOOPBACK_IP_V4;
  RawDatagramSocket.bind(address, 0).then((producer) {
    RawDatagramSocket.bind(address, 0).then((receiver) {
      Timer timer2;
      List<int> sList = new List<int>(sentLength);
      for (int i = 0; i < sentLength; i++) {
        sList[i] = i & 0xff;
      }

      producer.send(sList, address, receiver.port);
      producer.close();

      List<int> rList;

      receiver.listen((event) {
        var datagram = receiver.receive();
        if (datagram != null) {
          rList = datagram.data;
          print(rList.length);           // received datagram.data length
        }
        if (timer2 != null) timer2.cancel();
        timer2 = new Timer(const Duration(milliseconds: 200), () {
          receiver.close();
        });
      });
    });
  });
}

Reproduced with Dart VM version: 2.0.0-dev.14.0 (Wed Dec 20 10:43:00 2017 +0100) on "linux_x64".

@a-siva a-siva added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-io labels Jan 3, 2018
@sgrekhov
Copy link
Contributor

The issue still exists. Dart SDK version: 2.19.0-81.0.dev (dev) (Tue Aug 9 14:51:36 2022 -0700) on "windows_x64"

@rmacnak-google
Copy link
Contributor

@brianquinlan This test flaked recently. RawDatagramSocket.receive should probably remove the maximum length claim, as IPv6 jumbograms might produce much larger datagrams.

@brianquinlan brianquinlan self-assigned this Oct 19, 2023
copybara-service bot pushed a commit that referenced this issue Oct 23, 2023
…m size is 64K.

Bug:#31733
CoreLibraryReviewExempt:documentation-only
Change-Id: Icde611deb9a0172a5caacf518e9ce01904baf8ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331422
Commit-Queue: Brian Quinlan <[email protected]>
Reviewed-by: Ryan Macnak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. gardening library-io
Projects
None yet
Development

No branches or pull requests

5 participants