Module socket

Index

Interfaces

Functions

Functions

accept(socketId: number, callback?: (acceptInfo: chrome.socket.AcceptInfo) => void)

Parameters

  • socketId: number
  • callback?: (acceptInfo: chrome.socket.AcceptInfo) => void optional

bind(socketId: number, address: string, port: number, callback: (result: number) => void)

Parameters

  • socketId: number
  • address: string
  • port: number
  • callback: (result: number) => void

connect(socketId: number, hostname: string, port: number, callback: (result: number) => void)

Parameters

  • socketId: number
  • hostname: string
  • port: number
  • callback: (result: number) => void

create(type: string, options?: Object, callback?: (createInfo: chrome.socket.CreateInfo) => void)

Parameters

  • type: string
  • options?: Object optional
  • callback?: (createInfo: chrome.socket.CreateInfo) => void optional

destroy(socketId: number)

Parameters

  • socketId: number

disconnect(socketId: number)

Parameters

  • socketId: number

getInfo(socketId: number, callback: (result: chrome.socket.SocketInfo) => void)

Parameters

  • socketId: number
  • callback: (result: chrome.socket.SocketInfo) => void

getNetworkList(callback: (result: chrome.socket.NetworkInterface[]) => void)

Parameters

  • callback: (result: chrome.socket.NetworkInterface[]) => void

listen(socketId: number, address: string, port: number, backlog?: number, callback?: (result: number) => void)

Parameters

  • socketId: number
  • address: string
  • port: number
  • backlog?: number optional
  • callback?: (result: number) => void optional

read(socketId: number, bufferSize?: number, callback?: (readInfo: chrome.socket.ReadInfo) => void)

Parameters

  • socketId: number
  • bufferSize?: number optional
  • callback?: (readInfo: chrome.socket.ReadInfo) => void optional

recvFrom(socketId: number, bufferSize?: number, callback?: (recvFromInfo: chrome.socket.RecvFromInfo) => void)

Parameters

  • socketId: number
  • bufferSize?: number optional
  • callback?: (recvFromInfo: chrome.socket.RecvFromInfo) => void optional

sendTo(socketId: number, data: ArrayBuffer, address: string, port: number, callback?: (writeInfo: chrome.socket.WriteInfo) => void)

Parameters

  • socketId: number
  • data: ArrayBuffer
  • address: string
  • port: number
  • callback?: (writeInfo: chrome.socket.WriteInfo) => void optional

setKeepAlive(socketId: number, enable: boolean, delay?: number, callback?: (result: boolean) => void)

Parameters

  • socketId: number
  • enable: boolean
  • delay?: number optional
  • callback?: (result: boolean) => void optional

setNoDelay(socketId: number, noDelay: boolean, callback?: (result: boolean) => void)

Parameters

  • socketId: number
  • noDelay: boolean
  • callback?: (result: boolean) => void optional

write(socketId: number, data: ArrayBuffer, callback?: (writeInfo: chrome.socket.WriteInfo) => void)

Parameters

  • socketId: number
  • data: ArrayBuffer
  • callback?: (writeInfo: chrome.socket.WriteInfo) => void optional