Write buffer change callbacks are executed when data is either flushed from the write buffer or written into write buffer THROUGH the message interface (i.e. with send(msg)) ONLY.
The TipcDataOutput write() methods themselves are accessible throughout this package. If data is added to write buffer by calling them directly, this will NOT trigger the write buffer change callbacks. This is because the purpose of the write buffer change callback is to allow the sending of client congestion messages. When the callback is triggered, if the congestion threshold has now been met, a congestion message will be sent out. This means that triggering the callbacks may result in data being written into the write buffer.
This, of course, cannot be allowed to happen in the middle of a message write. A congestion message must only be allowed to be written into the buffer when the logical write (not just the write() method call-- a logical write can consist of more than one call to the write() method; see TipcMsgImpl.writeWire() for an example) has been completed. Therefore, the writing of a message will trigger the write buffer change callback only AFTER the full message has been written (which involves possibly mutliple calls to the write() method).
By contrast, if the write() methods are invoked directly, outside of the message writing framework, there is no way to know, at the end of the write() method, whether or not the logical write has been completed. Therefore, there is no way to know if congestion message data may be safely added to the buffer at that time.
For a list of all members of this type, see TipcWriteBufferChangeCb Members.
Namespace: TIBCO.SMARTSOCKETS Namespace
Assembly: TIBCO.SS.dll
TipcWriteBufferChangeCb Members | TIBCO.SMARTSOCKETS Namespace