clear

fun clear()

Clears all the remaining incoming and outgoing messages, releasing any buffers that were wrapped in a byte buffer holder. This function should be called on logout and whenever a reconnection happens, in order to get rid of any messages that got written to the session, but couldn't be flushed out in time before the session became inactive.