Packages

trait ClientAttach[A <: ClientAttach[A]] extends AnyRef

Stores data associated to one TCP client. This abstract class provides basic reading and writing functionnality. Additionnal information and features may be added by the subclasses.

Thread-safety

  • The public methods of ClientAttach may be called from any thread without problem.
  • The protected methods are called from the Selector thread. In particular, HAttach.readHeader and ClientAttach.handleData don't need to be thread-safe.
  • The completion handlers are run on the Selector thread. Therefore they should NOT perform long computations. If you have long computations to do, send them to an ExecutorService or something similar.
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ClientAttach
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def handleData(buffer: NiolBuffer): Unit

    Handles the packet's data.

    Handles the packet's data.

    buffer

    the buffer view containing all the packet's data.

    Attributes
    protected
  2. abstract def listener: TcpListener[A]

    Returns the TcpListener to notify when the client disconnects.

    Returns the TcpListener to notify when the client disconnects.

    returns

    the TcpListener associated to this ClientAttach.

  3. abstract def readMore(): Unit

    Reads more data from the SocketChannel.

    Reads more data from the SocketChannel.

    Attributes
    protected[network]
  4. abstract def readTransform: Option[BytesTransform]

    Returns the function that transforms the received data.

    Returns the function that transforms the received data.

    returns

    the function, if any

  5. abstract def readTransform_=(t: BytesTransform): Unit

    Sets the function that is applied to the received data just after its receipt.

    Sets the function that is applied to the received data just after its receipt. The function is applied before the packets are reconstructed.

    To handle the packets, override the ClientAttach.handleData method.

    t

    the function

  6. abstract def streamEnded: Boolean

    Checks if the end of the stream has been reached.

    Checks if the end of the stream has been reached.

    returns

    true if the end of the stream has been reached, false otherwise

  7. abstract def write(buffer: NiolBuffer, completionHandler: () ⇒ Unit): Unit

    Asynchronously writes some data to the client, and executes the given completion handler when the operation completes.

    Asynchronously writes some data to the client, and executes the given completion handler when the operation completes.

    buffer

    the data to write

    completionHandler

    the handler to execute after the operation

  8. abstract def write(buffer: NiolBuffer): Unit

    Writes some data to the client.

    Writes some data to the client. The data isn't written immediately but at some time in the future. Therefore this method isn't blocking.

    buffer

    the data to write

  9. abstract def writeMore(): Boolean

    Writes more pending data, if any, to the SocketChannel.

    Writes more pending data, if any, to the SocketChannel.

    returns

    true if all the pending data has been written, false otherwise

    Attributes
    protected[network]
  10. abstract def writeTransform: Option[BytesTransform]

    Returns the function that transforms the outgoing data.

    Returns the function that transforms the outgoing data.

    returns

    the function, if any

  11. abstract def writeTransform_=(t: BytesTransform): Unit

    Sets the function that is applied to the outgoing data just before its sending.

    Sets the function that is applied to the outgoing data just before its sending.

    t

    the function

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped