views:

46

answers:

1

I already did a bit of research & tried a few things... but still can't find how to programmatic detect if there are any bytes (that maybe already be awaiting inside the outgoing queue) which had not been transmitted to the cable.

Thanks

A: 

Looks like Windows does not support it on the socket level. On Linux that would be SO_NWRITE option to getsockopt() API. But even if there's similar facility in Windows, since wire writes happen asynchronously to your process, the value you'd receive from the OS might be stale by the time your process gets it. So the usefulness of such information is at least questionable.

Nikolai N Fetissov
I guess that kinda confirms my findings. It's too bad windows doesn't have this, because SO_NWRITE "number of bytes written not yet sent by the protocol" sounds like what I needed. In term of usefulness, at least in my case, it would be useful (I am doing customize programming for inhouse prototype hardware cards). In this case I can live with some ms delays, as I am more interested if all bytes have left onto the wire; so I can info the card of this [a few ms after the fact is okay, but telling the card all byte has got onto the wire when they haven't yet -is totally no good]
richard
I'm not saying Windows doesn't have it, that I don't know, it's just not in the regular BSD socket options.
Nikolai N Fetissov
Not that it will help much in this case, but a proper link to the correct getsockopt() (not the WinCE one) is this: http://msdn.microsoft.com/en-us/library/ms738544%28VS.85%29.aspx.
Andreas Magnusson