Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Problem Sending Data with SocketServer.ThreadingTCPServer

Reply
Thread Tools

Problem Sending Data with SocketServer.ThreadingTCPServer

 
 
UrgeOverkill
Guest
Posts: n/a
 
      02-19-2004
I'm having a problem sending data from a socket server. The server
side reports that it has sent 4845 bytes but the client reports only
1448 bytes received. The kicker is that this ONLY happens accross the
internet... I've tested this with multiple connections. If I run the
same server and client, connect them locally I don't have a problem
with byte totals. Is there a timeout that I need to set... I've
looked at and change several SOL_SOCKET parameters (i.e. SO_SNDBUF,
etc) but this hasn't fixed my problem... This is the last thing I need
to fix on this and any help would be greatly appreciated...
 
Reply With Quote
 
 
 
 
Dave Brueck
Guest
Posts: n/a
 
      02-19-2004
Urge wrote:
> I'm having a problem sending data from a socket server. The server
> side reports that it has sent 4845 bytes but the client reports only
> 1448 bytes received. The kicker is that this ONLY happens accross the
> internet... I've tested this with multiple connections. If I run the
> same server and client, connect them locally I don't have a problem
> with byte totals. Is there a timeout that I need to set... I've
> looked at and change several SOL_SOCKET parameters (i.e. SO_SNDBUF,
> etc) but this hasn't fixed my problem... This is the last thing I need
> to fix on this and any help would be greatly appreciated...


How about posting some code if you can... Are you sure that the client has
received all the data that is available? It may take several recv (or read)
calls - just because your first receive obtained 1448 bytes doesn't mean that
there's nothing more on the way.

-Dave


 
Reply With Quote
 
 
 
 
Peter Hansen
Guest
Posts: n/a
 
      02-19-2004
UrgeOverkill wrote:
>
> I'm having a problem sending data from a socket server. The server
> side reports that it has sent 4845 bytes but the client reports only
> 1448 bytes received. The kicker is that this ONLY happens accross the
> internet... I've tested this with multiple connections. If I run the
> same server and client, connect them locally I don't have a problem
> with byte totals. Is there a timeout that I need to set... I've
> looked at and change several SOL_SOCKET parameters (i.e. SO_SNDBUF,
> etc) but this hasn't fixed my problem... This is the last thing I need
> to fix on this and any help would be greatly appreciated...


Example code?

You don't give quite enough info for one to how familiar you are with
socket programming. Are you aware, for example, that you have to read
repeatedly from the socket, not just call .recv() once? (That's a common
rookie mistake.)

What code is generating these reports about bytes sent and received?
Why do you trust the numbers? Just because a high level call with 4845
bytes went down into the .send routine and returned doesn't mean that
many bytes actually went out the port.

Have you reduced this down to the smallest program you can make which
demonstrates the problem? Often the problem will go away at some
point as you do that, and then you can quickly home in on the change
which was involved.

-Peter
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem sending mail: Sending the email to the following server failed Luke Java 2 03-15-2007 10:54 AM
sending data to another server and receiving data as response pintu ASP .Net Web Services 0 12-14-2006 09:36 AM
pls help me when i sent mail, it vil sending twice instead of once ,am using java.mail,am sending my code.... shailajabtech@gmail.com Java 0 09-28-2006 06:38 AM
Big Problem with Web App Sending Wrong Data! HELP! David Hearn ASP .Net 0 04-18-2005 08:55 PM
Problem with sending data via the Post method. (URGENT) Vishal ASP .Net 5 12-28-2004 07:57 PM



Advertisments