Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Weird socket problem

Name: Anonymous 2011-01-15 1:57

/prog/ I come to you for help with my superior ENTERPRISE(tm) programming.

The test environment is Windows XP running under VirtualBox and I'm using Python to execute the program.

Basically I want to send n amount of data with socket.send and have a reliable estimate on how long it has taken to send n bytes. I am using sockets with a timeout of 15 seconds. Let me explain in my own words why I haven't been able to do what I want:

Apparently send works with network buffers. It just adds what I'm trying to send to the network buffer and returns the amount of data it passed to this buffer, only ever blocking/sleeping when the buffer is full. So in other words, send doesn't actually send anything. So even when I send large amounts of data, 100MB or more, send returns instantly, WTF.

Shouldn't the buffer be a reasonable size, and if send really does work like this how am I to determine how many bytes have been actually sent?

Note: I don't want to use a protocol, i.e. have the client return how many bytes received because I'm working on a socket class.

Note: I don't have this problem with recv it seems . . .

Please help me /prog/, no troll.

Name: Anonymous 2011-01-16 0:54

>>19
No, I'm saying you should just live with the fact that it's buffered. Why are you trying to take a measurement anyway? If it has anything to do with time estimations the data will be sent before you can get enough samples to make an estimate anyway. If it is to measure throughput capacity you can't do that without saturating anyhow.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List