DiscordPHP-Voice Documentation

SocketFactory extends Factory
in package

FinalYes

Table of Contents

Properties

$ws  : WS|null

Methods

__construct()  : mixed
createClient()  : mixed

Properties

Methods

__construct()

public __construct([mixed $loop = null ][, mixed $resolver = null ][, WS|null $ws = null ]) : mixed
Parameters
$loop : mixed = null

ReactPHP event loop; defaults to the global loop.

$resolver : mixed = null

DNS resolver; when null, one is built from $ws->data['dnsConfig'].

$ws : WS|null = null

Voice WebSocket, required when $resolver is null and used to wire UDP sockets back to the gateway.

Tags
throws
InvalidArgumentException

if neither a resolver nor a WS instance is given.

createClient()

public createClient(mixed $address) : mixed
Parameters
$address : mixed
Tags
inheritDoc

Resolves $address and returns a UDP client wired back to this factory's WS instance.

throws
Exception

if the client socket cannot be created.

On this page

Search results