Server Not able to read messages of length>256 bytes in a typicalClient Server Scenario

Discussion in 'C Programming' started by Ravikanth, Nov 28, 2008.

  1. Ravikanth

    Ravikanth Guest

    Hi all,

    How do i retreive the default socket receive buffer size.

    I am implementing a Client Server program in which i got an issue.
    When the client is sending some message, the server receives it and
    reads the message.

    Actually my implemenation goes like this.

    A client Tcl script opens a pipe with a C program, which acts a
    client which communicates with another C program which acts as a
    server.

    I havent set any properties of the socket on which the Server is
    listening, and accepting connections, and also in the client C
    program.

    Every thing was working fine until a message of length say 350 bytes
    is sent from the client Tcl script via the Client C program to the
    server.

    For verification purposes i have added the code in the server to check
    how many number of bytes are received from the client.

    When the client is sending 350 bytes , the server is receiving only
    104 bytes.

    After a little debugging, what i observed is it is just reading the
    104 bytes starting from 257th Byte in the received message to 349th
    Byte in the message.

    I also observed that sending a message of length less than 256 byte,
    the server is able to read it completely.
    But if i m sending from the client a message of length> 256 bytes, it
    is only reading the excess bytes.
    Is there any default size of the message which the server can read.
    My requirement is the Server has to read the entire 350 bytes sent.

    Could any one help me solving this problem.
    Should i modify any of the socket properites in Server and Client C
    programs or should i set some properties in the Tcl script.
    Please help me solving this problem.

    Thanks in Advance !!!
    Ravikanth
    Ravikanth, Nov 28, 2008
    #1
    1. Advertising

  2. Ravikanth

    Flash Gordon Guest

    Ravikanth wrote, On 28/11/08 06:49:
    > Hi all,
    >
    > How do i retreive the default socket receive buffer size.



    This will be implementation specific, so you need to ask in a group
    dealing with your implementation. If you are using Unix or Linux I
    suggest comp.unix.programmer.

    <snip>

    > When the client is sending 350 bytes , the server is receiving only
    > 104 bytes.


    <snip>

    This suggests to me your problem is not what you think it is. I suggest
    you use a network monitor such as Wireshark to see what is really being
    sent, I suspect it is not what you think. Then try asking about your Tcl
    code in a Tcl group and your C code (which is probably implementation
    specific code due to the networking) in a group for your implementation.
    In each case you will have to post actual code.
    --
    Flash Gordon
    If spamming me sent it to
    If emailing me use my reply-to address
    See the comp.lang.c Wiki hosted by me at http://clc-wiki.net/
    Flash Gordon, Nov 28, 2008
    #2
    1. Advertising

  3. Ravikanth

    Ravikanth Guest

    On Nov 28, 1:43 pm, Flash Gordon <> wrote:
    > Ravikanth wrote, On 28/11/08 06:49:
    >
    > > Hi all,

    >
    > > How do i  retreive the default socket receive buffer size.

    >
    > This will be implementation specific, so you need to ask in a group
    > dealing with your implementation. If you are using Unix or Linux I
    > suggest comp.unix.programmer.
    >
    > <snip>
    >
    > > When the client is sending 350 bytes , the server is receiving only
    > > 104 bytes.

    >
    > <snip>
    >
    > This suggests to me your problem is not what you think it is. I suggest
    > you use a network monitor such as Wireshark to see what is really being
    > sent, I suspect it is not what you think. Then try asking about your Tcl
    > code in a Tcl group and your C code (which is probably implementation
    > specific code due to the networking) in a group for your implementation.
    > In each case you will have to post actual code.
    > --
    > Flash Gordon
    > If spamming me sent it to
    > If emailing me use my reply-to address
    > See the comp.lang.c Wiki hosted by me athttp://clc-wiki.net/


    Thanks Gordon,

    I will try to use WireShark and let you know what the problem i faced.
    Ravikanth, Nov 28, 2008
    #3
  4. Ravikanth

    Flash Gordon Guest

    Ravikanth wrote, On 28/11/08 16:53:
    > On Nov 28, 1:43 pm, Flash Gordon <> wrote:
    >> Ravikanth wrote, On 28/11/08 06:49:


    <snip>

    >>> When the client is sending 350 bytes , the server is receiving only
    >>> 104 bytes.

    >> <snip>
    >>
    >> This suggests to me your problem is not what you think it is. I suggest
    >> you use a network monitor such as Wireshark to see what is really being
    >> sent, I suspect it is not what you think. Then try asking about your Tcl
    >> code in a Tcl group and your C code (which is probably implementation
    >> specific code due to the networking) in a group for your implementation.
    >> In each case you will have to post actual code.
    >> --
    >> Flash Gordon
    >> If spamming me sent it to
    >> If emailing me use my reply-to address
    >> See the comp.lang.c Wiki hosted by me athttp://clc-wiki.net/


    Please don't quote signatures, i.e. the bit typically after the "-- "

    > Thanks Gordon,
    >
    > I will try to use WireShark and let you know what the problem i faced.


    Please bare in mind that the problem might well not be with the C but
    with the implementation specifics, and if it is then you will get better
    advice from a group dealing with your implementation. However, if it
    looks to be a problem with the C then here is certainly the right place.
    --
    Flash Gordon
    If spamming me sent it to
    If emailing me use my reply-to address
    See the comp.lang.c Wiki hosted by me at http://clc-wiki.net/
    Flash Gordon, Nov 28, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    2
    Views:
    506
    Guest
    Jul 29, 2005
  2. M-One
    Replies:
    43
    Views:
    1,465
    Mark McIntyre
    Jul 16, 2003
  3. Yandos
    Replies:
    12
    Views:
    5,111
    Pete Becker
    Sep 15, 2005
  4. Phil C.
    Replies:
    3
    Views:
    233
    Joe Kaplan \(MVP - ADSI\)
    Feb 25, 2005
  5. sed_y
    Replies:
    0
    Views:
    1,011
    sed_y
    Feb 15, 2012
Loading...

Share This Page