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

R

Ravikanth

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
 
F

Flash Gordon

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.

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.
 
R

Ravikanth

Ravikanth wrote, On 28/11/08 06:49:



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>

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 (e-mail address removed)
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.
 
F

Flash Gordon

Ravikanth wrote, On 28/11/08 16:53:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top