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-15 22:59

>>17
IMO you might as well deal with a bit of buffer. If you're not saturating the throughput capacity your measurements are going to reveal more about the scheduler and system performance than anything else. If you do saturate then I/O will get held up and you will get a meaningful measurement. Your OS might choose to express this through scheduling, but the result will match up with your output about as accurately as you can hope for.

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