MCPcopy Create free account
hub / github.com/vercel/vercel / close

Method close

python/vercel-runtime/tests/test_runtime.py:374–387  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

372 self._sock.sendall(_encode_client_ws_frame(0x1, text.encode("utf-8")))
373
374 def close(self) -> None:
375 if self._sock.fileno() == -1:
376 return
377
378 with contextlib.suppress(OSError):
379 self._sock.sendall(
380 _encode_client_ws_frame(0x8, struct.pack("!H", 1000))
381 )
382
383 with contextlib.suppress(ConnectionError, OSError, socket.timeout):
384 _read_ws_frame(self._reader)
385
386 with contextlib.suppress(OSError):
387 self._sock.close()
388
389
390def _dechunk(data: bytes) -> bytes:

Callers 5

_invoke_lambdaFunction · 0.45
connectMethod · 0.45

Calls 4

_encode_client_ws_frameFunction · 0.85
_read_ws_frameFunction · 0.85
filenoMethod · 0.80
sendallMethod · 0.45

Tested by

no test coverage detected