in reply to Re^3: Net::Server only sends 128bytes at a time
in thread Net::Server only sends 128bytes at a time

I get the same thing with your code too.
As can be seen from wireshark, the sending packets are set to 128bytes.
Transmission Control Protocol, Src Port: atmp (5150), Dst Port: 53616 (53616), Seq: 129, Ack: 55, Len: 128

I checked the buffers in my receiving software and it is set to 1400 bytes for Ethernet buffers.

As for the MSS it's set as follows:
TCP 53616 > atmp SYN Seq=0 Win=256 Len=0 MSS=1324
and
TCP atmp > 53616 SYN, ACK Seq=0 Ack=1 Win=5840 Len=0 MSS=1380
Both are much bigger than 128.

Aaron

  • Comment on Re^4: Net::Server only sends 128bytes at a time

Replies are listed 'Best First'.
Re^5: Net::Server only sends 128bytes at a time
by zwon (Abbot) on Dec 17, 2009 at 23:11 UTC

    Well, what about this example:

    #include <stdio.h> #include <sys/socket.h> #include <netinet/in.h> #include <err.h> #include <string.h> int main() { int s, c; struct sockaddr_in sa; char buf[1024]; s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); if (s < 0) err(1, "can't create socket"); sa.sin_family = AF_INET; sa.sin_port = htons(7777); sa.sin_addr.s_addr = INADDR_ANY; if (bind(s, (struct sockaddr *) &sa, sizeof(sa)) < 0 || listen(s, 10) < 0) err(1, "can't bind"); c = accept(s, NULL, NULL); memset(buf, 'x', 1024); send(c, buf, 1024, 0); return 0; }
    if it also divides packets on 128 bytes chunks, it is nothing to do with perl and you better ask for help on http://ubuntuforums.org
Re^5: Net::Server only sends 128bytes at a time
by zwon (Abbot) on Dec 17, 2009 at 23:36 UTC

    Ah! Win=256 -- the window size is too small. Is this only for first segment or all segments are 128 bytes?