Skip to content

ConnectionSource beta ​

Interface of @v12-engine/engine/server

ts
export interface ConnectionSource

Where a game server's connections come from (GameServer.attach): onConnection is told of each one made, close closes them all. A socket server, or a room of a port that several share (GameRooms)

Members ​

close ​

ts
close(): Promise<void>;

Closes every connection it made

onConnection ​

ts
onConnection(handler: (connection: Connection) => void): void;

Who is told of each connection made: one handler, the last given

port ​

ts
readonly port: number;

The port they come in at