Class

io.scalajs.nodejs.net

SocketExtensions

Related Doc: package net

Permalink

implicit final class SocketExtensions extends AnyVal

net.Socket Extensions

Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SocketExtensions
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SocketExtensions(socket: Socket)

    Permalink

    socket

    the given socket

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def connectFuture(port: Int, host: String): Future[Unit]

    Permalink

    Opens the connection for a given socket.

    Opens the connection for a given socket.

    port

    the port number

    host

    the host name or IP

    returns

    a promise of an outcome

    Annotations
    @inline()
  6. def connectFuture(port: Int): Future[Unit]

    Permalink

    Opens the connection for a given socket.

    Opens the connection for a given socket.

    port

    the port number

    returns

    a promise of an outcome

    Annotations
    @inline()
  7. def connectFuture(path: String): Future[Unit]

    Permalink

    Opens the connection for a given socket.

    Opens the connection for a given socket.

    path

    the connection path

    returns

    a promise of an outcome

    Annotations
    @inline()
  8. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  9. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  10. def onClose(callback: (Boolean) ⇒ Any): socket.type

    Permalink

    Emitted once the socket is fully closed.

    Emitted once the socket is fully closed. The argument had_error is a boolean which says if the socket was closed due to a transmission error.

    callback

    - had_error <Boolean> true if the socket had a transmission error.

    Annotations
    @inline()
    Example:
    1. socket.on("close", function(had_error) { ... })

  11. def onConnect(callback: Function): socket.type

    Permalink

    Emitted when a socket connection is successfully established.

    Emitted when a socket connection is successfully established. See connect().

    callback

    the callback

    Annotations
    @inline()
    Example:
    1. socket.on("connect", function() { ... })

  12. def onData(callback: (Buffer) ⇒ Any): socket.type

    Permalink

    Emitted when data is received.

    Emitted when data is received. The argument data will be a Buffer or String. Encoding of data is set by socket.setEncoding(). (See the Readable Stream section for more information.)

    Note that the data will be lost if there is no listener when a Socket emits a 'data' event.

    callback

    - <Buffer>

    Annotations
    @inline()
    Example:
    1. socket.on("data", function(buffer) { ... })

  13. def onDrain(callback: Function): socket.type

    Permalink

    Emitted when the write buffer becomes empty.

    Emitted when the write buffer becomes empty. Can be used to throttle uploads.

    See also: the return values of socket.write()

    callback

    the callback

    Annotations
    @inline()
    Example:
    1. socket.on("drain", function(???) { ... })

  14. def onEnd(callback: Function): socket.type

    Permalink

    Emitted when the other end of the socket sends a FIN packet.

    Emitted when the other end of the socket sends a FIN packet.

    By default (allowHalfOpen == false) the socket will destroy its file descriptor once it has written out its pending write queue. However, by setting allowHalfOpen == true the socket will not automatically end() its side allowing the user to write arbitrary amounts of data, with the caveat that the user is required to end() their side now.

    callback

    the callback

    Annotations
    @inline()
    Example:
    1. socket.on("end", function(???) { ... })

  15. def onLookup(callback: (Error, String, String, String) ⇒ Any): socket.type

    Permalink

    Emitted after resolving the hostname but before connecting.

    Emitted after resolving the hostname but before connecting. Not applicable to UNIX sockets.

    callback

    the callback, with the following arguments:

    • err <Error> | <Null> The error object. See dns.lookup().
    • address <String> The IP address.
    • family <String> | <Null> The address type. See dns.lookup().
    • host <String> The hostname.
    Annotations
    @inline()
    Example:
    1. socket.on("lookup", function(err, address, family, host) { ... })

  16. def onTimeout(callback: Function): socket.type

    Permalink

    Emitted if the socket times out from inactivity.

    Emitted if the socket times out from inactivity. This is only to notify that the socket has been idle. The user must manually close the connection.

    See also: socket.setTimeout()

    callback

    the callback

    Annotations
    @inline()
    Example:
    1. socket.on("timeout", function(???) { ... })

  17. val socket: Socket

    Permalink

    the given socket

  18. def toString(): String

    Permalink
    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped