import { Server } from "https://deno.land/x/socket_io@0.2.0/mod.ts";
Closes the server.
Examples
import { serve } from "https://deno.land/std@a.b.c/http/server.ts";
import { Server } from "https://deno.land/x/socket_io@x.y.z/mod.ts";
import { serve } from "https://deno.land/std@a.b.c/http/server.ts"; import { Server } from "https://deno.land/x/socket_io@x.y.z/mod.ts";
const io = new Server(); const abortController = new AbortController();
await serve(io.handler(), { port: 3000, signal: abortController.signal, onListen: () => { setTimeout(() => { // close the HTTP server abortController.abort(); // close the Socket.IO server server.close(); }, 10000); } });