readDataFromSocket(SelectionKey key) Sample data handler method for a channel with data ready to read.
Parameters: key - A SelectionKey object associated with a channeldetermined by the selector to be ready for reading.
Sample data handler method for a channel with data ready to read.
Parameters: key - A SelectionKey object associated with a channeldetermined by the selector to be ready for reading. If thechannel returns an EOF condition, it is closed here, whichautomatically invalidates the associated key. The selectorwill then de-register the channel on the next select call.