James Carlson wrote:

Wojtek Meler writes:

On Linux you can call

 ioctl(fd, TIOCOUTQ, &data_size);

to check if data has been sent. Is it possible in Solaris?


No.  First of all, the TIOC* ioctls are for ttys, not sockets, so the
Linux implementation of this is just pure hackery.

There are two Solaris CRs related to this.  One is CR 6366458, which
is the usage you're suggesting, and is currently marked as
"incomplete" because it doesn't seem to make sense.  The other is CR
4875565, which notes that the ioctl isn't actually implemented by any
tty driver, and either should be supported by them or removed from the
header file.

The reason it doesn't make sense to implement this for sockets is that
there appears to be no good way to do it correctly and, frankly, any
application that attempts to use it is probably doing something that
can be done better some other way.

I can imagine at least three different intended semantics for this
ioctl when used with TCP:

 1. It reports all unsent data.

 2. It reports all unsent and unacknowledged data.


I've come across people who think they want (1) for the purpose
of being able to bill on the number of bytes they've sent from their
application.

It's debatable whether or not they really want (2) but they didn't
want (3).

To address their problem, we recommended they use a dtrace script
to monitor how much data was discarded when the socket was closed.

Darren

_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to