Socket

@JSImport("dgram", "Socket") @native @JSType class Socket() extends StObject
trait StObject
class Object
trait Any
class Object
trait Matchable
class Any

Value members

Constructors

def this(options: EventEmitterOptions)

Concrete methods

def addListener(event: String, listener: Function1[Any, Unit]): Socket

events.EventEmitter

events.EventEmitter

  1. close
  2. connect
  3. error
  4. listening
  5. message
@JSName("addListener")
def addListener_close(event: close, listener: Function0[Unit]): Socket
@JSName("addListener")
def addListener_connect(event: connect, listener: Function0[Unit]): Socket
@JSName("addListener")
def addListener_error(event: error, listener: Function1[Error, Unit]): Socket
@JSName("addListener")
def addListener_listening(event: listening, listener: Function0[Unit]): Socket
@JSName("addListener")
def addListener_message(event: message, listener: Function2[Buffer, RemoteInfo, Unit]): Socket
def addMembership(multicastAddress: String): Unit
def addMembership(multicastAddress: String, multicastInterface: String): Unit
def addSourceSpecificMembership(sourceAddress: String, groupAddress: String): Unit

Tells the kernel to join a source-specific multicast channel at the given sourceAddress and groupAddress, using the multicastInterface with the IP_ADD_SOURCE_MEMBERSHIP socket option. If the multicastInterface argument is not specified, the operating system will choose one interface and will add membership to it. To add membership to every available interface, call socket.addSourceSpecificMembership() multiple times, once per interface.

Tells the kernel to join a source-specific multicast channel at the given sourceAddress and groupAddress, using the multicastInterface with the IP_ADD_SOURCE_MEMBERSHIP socket option. If the multicastInterface argument is not specified, the operating system will choose one interface and will add membership to it. To add membership to every available interface, call socket.addSourceSpecificMembership() multiple times, once per interface.

def addSourceSpecificMembership(sourceAddress: String, groupAddress: String, multicastInterface: String): Unit
def bind(): Unit
def bind(callback: Function0[Unit]): Unit
def bind(options: BindOptions): Unit
def bind(options: BindOptions, callback: Function0[Unit]): Unit
def bind(port: Double): Unit
def bind(port: Double, address: String): Unit
def bind(port: Double, address: String, callback: Function0[Unit]): Unit
def bind(port: Double, address: Unit, callback: Function0[Unit]): Unit
def bind(port: Double, callback: Function0[Unit]): Unit
def bind(port: Unit, address: String): Unit
def bind(port: Unit, address: String, callback: Function0[Unit]): Unit
def bind(port: Unit, address: Unit, callback: Function0[Unit]): Unit
def bind(port: Unit, callback: Function0[Unit]): Unit
def close(): Unit
def close(callback: Function0[Unit]): Unit
def connect(port: Double): Unit
def connect(port: Double, address: String): Unit
def connect(port: Double, address: String, callback: Function0[Unit]): Unit
def connect(port: Double, address: Unit, callback: Function0[Unit]): Unit
def connect(port: Double, callback: Function0[Unit]): Unit
def disconnect(): Unit
def dropMembership(multicastAddress: String): Unit
def dropMembership(multicastAddress: String, multicastInterface: String): Unit
def dropSourceSpecificMembership(sourceAddress: String, groupAddress: String): Unit

Instructs the kernel to leave a source-specific multicast channel at the given sourceAddress and groupAddress using the IP_DROP_SOURCE_MEMBERSHIP socket option. This method is automatically called by the kernel when the socket is closed or the process terminates, so most apps will never have reason to call this.

Instructs the kernel to leave a source-specific multicast channel at the given sourceAddress and groupAddress using the IP_DROP_SOURCE_MEMBERSHIP socket option. This method is automatically called by the kernel when the socket is closed or the process terminates, so most apps will never have reason to call this.

If multicastInterface is not specified, the operating system will attempt to drop membership on all valid interfaces.

def dropSourceSpecificMembership(sourceAddress: String, groupAddress: String, multicastInterface: String): Unit
def emit(event: String, args: Any*): Boolean
def emit(event: Symbol, args: Any*): Boolean
@JSName("emit")
def emit_close(event: close): Boolean
@JSName("emit")
def emit_connect(event: connect): Boolean
@JSName("emit")
def emit_error(event: error, err: Error): Boolean
@JSName("emit")
def emit_listening(event: listening): Boolean
@JSName("emit")
def emit_message(event: message, msg: Buffer, rinfo: RemoteInfo): Boolean
def getRecvBufferSize(): Double
def getSendBufferSize(): Double
def on(event: String, listener: Function1[Any, Unit]): Socket
@JSName("on")
def on_close(event: close, listener: Function0[Unit]): Socket
@JSName("on")
def on_connect(event: connect, listener: Function0[Unit]): Socket
@JSName("on")
def on_error(event: error, listener: Function1[Error, Unit]): Socket
@JSName("on")
def on_listening(event: listening, listener: Function0[Unit]): Socket
@JSName("on")
def on_message(event: message, listener: Function2[Buffer, RemoteInfo, Unit]): Socket
def once(event: String, listener: Function1[Any, Unit]): Socket
@JSName("once")
def once_close(event: close, listener: Function0[Unit]): Socket
@JSName("once")
def once_connect(event: connect, listener: Function0[Unit]): Socket
@JSName("once")
def once_error(event: error, listener: Function1[Error, Unit]): Socket
@JSName("once")
def once_listening(event: listening, listener: Function0[Unit]): Socket
@JSName("once")
def once_message(event: message, listener: Function2[Buffer, RemoteInfo, Unit]): Socket
def prependListener(event: String, listener: Function1[Any, Unit]): Socket
@JSName("prependListener")
def prependListener_close(event: close, listener: Function0[Unit]): Socket
@JSName("prependListener")
def prependListener_connect(event: connect, listener: Function0[Unit]): Socket
@JSName("prependListener")
def prependListener_error(event: error, listener: Function1[Error, Unit]): Socket
@JSName("prependListener")
def prependListener_listening(event: listening, listener: Function0[Unit]): Socket
@JSName("prependListener")
def prependListener_message(event: message, listener: Function2[Buffer, RemoteInfo, Unit]): Socket
def prependOnceListener(event: String, listener: Function1[Any, Unit]): Socket
@JSName("prependOnceListener")
def prependOnceListener_close(event: close, listener: Function0[Unit]): Socket
@JSName("prependOnceListener")
def prependOnceListener_connect(event: connect, listener: Function0[Unit]): Socket
@JSName("prependOnceListener")
def prependOnceListener_error(event: error, listener: Function1[Error, Unit]): Socket
@JSName("prependOnceListener")
def prependOnceListener_listening(event: listening, listener: Function0[Unit]): Socket
@JSName("prependOnceListener")
def prependOnceListener_message(event: message, listener: Function2[Buffer, RemoteInfo, Unit]): Socket
def ref(): Socket
def send(msg: String): Unit
def send(msg: String, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: String, offset: Double, length: Double): Unit
def send(msg: String, offset: Double, length: Double, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: String, offset: Double, length: Double, port: Double): Unit
def send(msg: String, offset: Double, length: Double, port: Double, address: String): Unit
def send(msg: String, offset: Double, length: Double, port: Double, address: String, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: String, offset: Double, length: Double, port: Double, address: Unit, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: String, offset: Double, length: Double, port: Double, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: String, offset: Double, length: Double, port: Unit, address: String): Unit
def send(msg: String, offset: Double, length: Double, port: Unit, address: String, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: String, offset: Double, length: Double, port: Unit, address: Unit, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: String, offset: Double, length: Double, port: Unit, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: String, port: Double): Unit
def send(msg: String, port: Double, address: String): Unit
def send(msg: String, port: Double, address: String, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: String, port: Double, address: Unit, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: String, port: Double, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: String, port: Unit, address: String): Unit
def send(msg: String, port: Unit, address: String, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: String, port: Unit, address: Unit, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: String, port: Unit, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Array[Any]): Unit
def send(msg: Array[Any], callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Array[Any], port: Double): Unit
def send(msg: Array[Any], port: Double, address: String): Unit
def send(msg: Array[Any], port: Double, address: String, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Array[Any], port: Double, address: Unit, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Array[Any], port: Double, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Array[Any], port: Unit, address: String): Unit
def send(msg: Array[Any], port: Unit, address: String, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Array[Any], port: Unit, address: Unit, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Array[Any], port: Unit, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Uint8Array): Unit
def send(msg: Uint8Array, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Uint8Array, offset: Double, length: Double): Unit
def send(msg: Uint8Array, offset: Double, length: Double, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Uint8Array, offset: Double, length: Double, port: Double): Unit
def send(msg: Uint8Array, offset: Double, length: Double, port: Double, address: String): Unit
def send(msg: Uint8Array, offset: Double, length: Double, port: Double, address: String, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Uint8Array, offset: Double, length: Double, port: Double, address: Unit, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Uint8Array, offset: Double, length: Double, port: Double, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Uint8Array, offset: Double, length: Double, port: Unit, address: String): Unit
def send(msg: Uint8Array, offset: Double, length: Double, port: Unit, address: String, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Uint8Array, offset: Double, length: Double, port: Unit, address: Unit, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Uint8Array, offset: Double, length: Double, port: Unit, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Uint8Array, port: Double): Unit
def send(msg: Uint8Array, port: Double, address: String): Unit
def send(msg: Uint8Array, port: Double, address: String, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Uint8Array, port: Double, address: Unit, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Uint8Array, port: Double, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Uint8Array, port: Unit, address: String): Unit
def send(msg: Uint8Array, port: Unit, address: String, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Uint8Array, port: Unit, address: Unit, callback: Function2[Error | Null, Double, Unit]): Unit
def send(msg: Uint8Array, port: Unit, callback: Function2[Error | Null, Double, Unit]): Unit
def setBroadcast(flag: Boolean): Unit
def setMulticastInterface(multicastInterface: String): Unit
def setMulticastLoopback(flag: Boolean): Unit
def setMulticastTTL(ttl: Double): Unit
def setRecvBufferSize(size: Double): Unit
def setSendBufferSize(size: Double): Unit
def setTTL(ttl: Double): Unit
def unref(): Socket

Inherited methods

def hasOwnProperty(v: String): Boolean
Inherited from
Object
def isPrototypeOf(v: Object): Boolean
Inherited from
Object
def propertyIsEnumerable(v: String): Boolean
Inherited from
Object
def toLocaleString(): String
Inherited from
Object
def valueOf(): Any
Inherited from
Object