473,396 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem Sending Data with SocketServer.ThreadingTCPServer

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...
Jul 18 '05 #1
2 3476
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
Jul 18 '05 #2
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
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ergin Aytac | last post by:
I'm trying to run a script written in python and have some socket connection problems. I cutted the origin script (more than 1000 lines) so it is only the part of the connection and there is no...
3
by: huy | last post by:
Hi All, Can someone explain why this bit of code can't keep up with some java code which spawns about 200 (threads) simultaneous connections each sending about 10 mesgs each. I basically don't...
5
by: missiplicity | last post by:
Hi, I am newbie to Python language and am taking my baby steps. I am using Python2.4 from ActiveState on W2K. I am trying to create a simple SocketServer program. Just adding the following 2 lines...
3
by: John Abel | last post by:
I'm hoping this is something simple, and someone can point me in the right direction here. I have a class based on SocketServer (ThreadingTCPServer), and I've used makefile on the socket so I use...
4
by: Pete Davis | last post by:
I've written an async socket server app and I'm having an issue with the EndReceive() call. My begin receive call is: sockState.RemoteSocket.BeginReceive(sockState.ReceiveBuffer, 0,...
5
by: Joshua J. Kugler | last post by:
Considering that UNIX Network Programming, Vol 1 (by W. Richard Stevens) recommends "_All_ TCP servers should specify to allow the server to be restarted ," and that self.allow_reuse_address =...
4
by: Daniel | last post by:
Hello, I'm trying to build a very simple IPC system. What I have done is create Data Transfer Objects (DTO) for each item I'd like to send across the wire. I am serializing these using...
1
by: Okko Willeboordse | last post by:
All, With Python 2.5 SocketServer features the shutdown method that can be called from another thread to stop the serve_forever loop. However; When the shutdown method is called before...
1
by: Okko Willeboordse | last post by:
Hello, SocketServer.ThreadingTCPServer accepts connections (clients can connect) before and after it's server_forever method is called, see below for an example. IMHO it should only accept...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.