(socket) send transmits data on same packet - Programmer

This is a discussion on (socket) send transmits data on same packet - Programmer ; Hi all, I noticed that when I use send() function to send data to remote PC, I see all the data on same packet (Wireshark) even though I used send more than once. For example, send("er"); send("an"); send("ya"); I will ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: (socket) send transmits data on same packet

  1. (socket) send transmits data on same packet

    Hi all,

    I noticed that when I use send() function to send data to remote PC, I
    see all the data on same packet (Wireshark) even though I used send
    more than once.

    For example,


    send("er");

    send("an");

    send("ya");


    I will see the data on same packet rether than 3 packets.


    thanks.


  2. Re: (socket) send transmits data on same packet

    In article <4af2b327-87ef-45b2-9f47-11d8b00f4a98@e39g2000hsf.googlegroups.com>,
    wrote:
    >Hi all,
    >
    >I noticed that when I use send() function to send data to remote PC, I
    >see all the data on same packet (Wireshark) even though I used send
    >more than once.
    >
    >For example,
    >
    >
    >send("er");
    >
    >send("an");
    >
    >send("ya");
    >
    >
    >I will see the data on same packet rether than 3 packets.


    You must be using TCP. That's how it works. TCP data can be bundled any
    way the TCP stack sees fit. You could try setting the TCP_NODELAY option
    on the socker to 1 (see setsockopt() - TCP_NODELAY in the SDK).

    Patrick
    ========= For LAN/WAN Protocol Analysis, check out PacketView Pro! =========
    Patrick Klos Email: patrick@klos.com
    Klos Technologies, Inc. Web: http://www.klos.com/
    ================================================== ==========================

+ Reply to Thread