Packages

abstract class HAttach[A <: HAttach[A]] extends ClientAttach[A]

An implementation of ClientAttach that processes packets that are prefixed by a header (hence the H in HAttach).

A

generic parameter

Linear Supertypes
ClientAttach[A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HAttach
  2. ClientAttach
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HAttach(sci: ServerChannelInfos[A], channel: SocketChannel, selectionKey: SelectionKey, rTransform: BytesTransform = null, wTransform: BytesTransform = null)

    sci

    infos about the ServerSocketChannel that accepted the client's connection

    channel

    the SocketChannel used to communicate with the client

    selectionKey

    the key representing the registration of the SocketChannel with the server

    rTransform

    a transformation to apply on the read data (received from the client)

    wTransform

    a transformation to apply on the written data (sent to the client)

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
    Definition Classes
    ClientAttach
  2. abstract def makeHeader(data: NiolBuffer): NiolBuffer

    Constructs a packet's header.

    Constructs a packet's header. This method should NOT advance the read position of the data buffer. If you need to read the packet's content, you should use NiolBuffer.duplicate first.

    data

    the packet's content

    returns

    a buffer containing the header's bytes

    Attributes
    protected
  3. abstract def readHeader(buffer: NiolBuffer): Int

    Tries to read the packet's header.

    Tries to read the packet's header.

    buffer

    the buffer view containing the header

    returns

    the length, in bytes, of the next packet data, or -1 if the header is incomplete.

    Attributes
    protected

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

    Definition Classes
    HAttachClientAttach
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def readMore(): Unit

    Reads more data from the SocketChannel.

    Reads more data from the SocketChannel.

    Attributes
    protected[network]
    Definition Classes
    HAttachClientAttach
    Annotations
    @tailrec()
  17. final 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

    Definition Classes
    HAttachClientAttach
  18. final def readTransform_=(f: 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.

    Definition Classes
    HAttachClientAttach
  19. final 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

    Definition Classes
    HAttachClientAttach
  20. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  25. final 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.

    This method constructs a header and prepends it to the data.

    buffer

    the data to write, not prefixed by a header

    completionHandler

    the handler to execute after the operation

    Definition Classes
    HAttachClientAttach
  26. final 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.

    This method constructs a header and prepends it to the data.

    buffer

    the data to write, not prefixed by a header

    Definition Classes
    HAttachClientAttach
  27. final 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]
    Definition Classes
    HAttachClientAttach
  28. final def writeRaw(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.

    This method doesn't construct a header, you need to provide it.

    buffer

    the data to write, prefixed by a header

    completionHandler

    the handler to execute after the operation

    See also

    ()=>Unit)

  29. final def writeRaw(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.

    This method doesn't construct a header, you need to provide it.

    buffer

    the data to write, prefixed by a header

    See also

    write(NiolBuffer)

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

    Definition Classes
    HAttachClientAttach
  31. final 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

    Definition Classes
    HAttachClientAttach

Inherited from ClientAttach[A]

Inherited from AnyRef

Inherited from Any

Ungrouped