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.
...

It would be remotely possible, though a bit difficult due to Solaris
architecture, to implement (1) or (2).  Unfortunately, I can't see a
usage model in which either value is interesting other than as a raw
statistic.  And as a statistic, we certainly need better ways to
expose that sort of connection information than via ioctls.


Actually, this is quite useful when working in a multiple machine
HA environment.  A typical use would be to accept an incoming
transaction and send it to a shadow machine to be run in parallel.

Once both machines have copies in memory, both machines can
process the transaction and then compare the results at the end.
Note that the artificial requirement is that the requested transaction
is stored in memory on at least two separate machines in different locations.

Yes, this can be done w/ an explicit ACK from the application, at
some additional number of micro/milliseconds latency.

Note that any asynchronous stream socket send implementation will need
essentially the same mechanism.

- Bart

--
Bart Smaalders                  Solaris Kernel Performance
[EMAIL PROTECTED]               http://blogs.sun.com/barts
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to