Spring Framwork Web on Servlet Stack v5.3.36 SNAPSHOT
1. Introduction to WebSocket. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 4.1.1. HTTP Versus WebSocket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 4.2. WebSocket API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 4.2.2. WebSocket Handshake . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .0 码力 | 259 页 | 3.58 MB | 1 年前3websockets Documentation Release 9.0
73 Index 75 i ii websockets Documentation, Release 9.0 websockets is a library for building WebSocket servers and clients in Python with a focus on correctness and simplicity. Built on top of asyncio hello(): uri = "ws://localhost:8765" async with websockets.connect(uri) as websocket: await websocket.send("Hello world!") await websocket.recv() asyncio.get_event_loop().run_until_complete(hello()) And here’s /usr/bin/env python import asyncio import websockets async def echo(websocket, path): async for message in websocket: await websocket.send(message) start_server = websockets.serve(echo, "localhost", 8765)0 码力 | 81 页 | 352.88 KB | 1 年前3websockets Documentation Release 5.0
Module Index 49 i ii websockets Documentation, Release 5.0 websockets is a library for building WebSocket servers and clients in Python with a focus on correctness and simplicity. Built on top of asyncio asyncio import websockets async def hello(uri): async with websockets.connect(uri) as websocket: await websocket.send("Hello world!") asyncio.get_event_loop().run_until_complete( hello('ws://localhost:8765')) /usr/bin/env python import asyncio import websockets async def echo(websocket, path): async for message in websocket: await websocket.send(message) asyncio.get_event_loop().run_until_complete( websockets0 码力 | 56 页 | 245.43 KB | 1 年前3websockets Documentation Release 6.0
Module Index 51 i ii websockets Documentation, Release 6.0 websockets is a library for building WebSocket servers and clients in Python with a focus on correctness and simplicity. Built on top of asyncio asyncio import websockets async def hello(uri): async with websockets.connect(uri) as websocket: await websocket.send("Hello world!") asyncio.get_event_loop().run_until_complete( hello('ws://localhost:8765')) /usr/bin/env python import asyncio import websockets async def echo(websocket, path): async for message in websocket: await websocket.send(message) asyncio.get_event_loop().run_until_complete( websockets0 码力 | 58 页 | 253.08 KB | 1 年前3websockets Documentation Release 4.0
Module Index 41 i ii websockets Documentation, Release 4.0 websockets is a library for building WebSocket servers and clients in Python with a focus on correctness and simplicity. Built on top of asyncio asyncio import websockets async def hello(uri): async with websockets.connect(uri) as websocket: await websocket.send("Hello world!") asyncio.get_event_loop().run_until_complete( hello('ws://localhost:8765')) /usr/bin/env python import asyncio import websockets async def echo(websocket, path): async for message in websocket: await websocket.send(message) asyncio.get_event_loop().run_until_complete( websockets0 码力 | 48 页 | 224.70 KB | 1 年前3websockets Documentation Release 3.4
Index 29 i ii websockets Documentation, Release 3.4 websockets is a library for developing WebSocket servers and clients in Python. It implements RFC 6455 with a focus on correctness and simplicity Here’s a WebSocket server example. It reads a name from the client, sends a greeting, and closes the connection. #!/usr/bin/env python import asyncio import websockets async def hello(websocket, path): path): name = await websocket.recv() print("< {}".format(name)) greeting = "Hello {}!".format(name) await websocket.send(greeting) print("> {}".format(greeting)) start_server = websockets.serve(hello, 'localhost'0 码力 | 36 页 | 192.66 KB | 1 年前3websockets Documentation Release 3.3
Index 25 i ii websockets Documentation, Release 3.3 websockets is a library for developing WebSocket servers and clients in Python. It implements RFC 6455 with a focus on correctness and simplicity Here’s a WebSocket server example. It reads a name from the client, sends a greeting, and closes the connection. #!/usr/bin/env python import asyncio import websockets async def hello(websocket, path): path): name = await websocket.recv() print("< {}".format(name)) greeting = "Hello {}!".format(name) await websocket.send(greeting) print("> {}".format(greeting)) start_server = websockets.serve(hello, 'localhost'0 码力 | 32 页 | 176.18 KB | 1 年前3websockets Documentation Release 3.2
Index 25 i ii websockets Documentation, Release 3.2 websockets is a library for developing WebSocket servers and clients in Python. It implements RFC 6455 with a focus on correctness and simplicity Here’s a WebSocket server example. It reads a name from the client, sends a greeting, and closes the connection. #!/usr/bin/env python import asyncio import websockets async def hello(websocket, path): path): name = await websocket.recv() print("< {}".format(name)) greeting = "Hello {}!".format(name) await websocket.send(greeting) print("> {}".format(greeting)) start_server = websockets.serve(hello, 'localhost'0 码力 | 32 页 | 170.46 KB | 1 年前3websockets Documentation Release 2.7
Index 21 i ii websockets Documentation, Release 2.7 websockets is a library for developing WebSocket servers and clients in Python. It implements RFC 6455 with a focus on correctness and simplicity example Here’s a WebSocket server example. It reads a name from the client and sends a message. #!/usr/bin/env python import asyncio import websockets @asyncio.coroutine def hello(websocket, path): name name = yield from websocket.recv() print("< {}".format(name)) greeting = "Hello {}!".format(name) yield from websocket.send(greeting) print("> {}".format(greeting)) start_server = websockets.serve(hello0 码力 | 28 页 | 157.50 KB | 1 年前3Tornado 6.1 Documentation
to a module, dictionary, or a list of modules and/or dicts. See UI modules for more details. • websocket_ping_interval: If set to a number, all websockets will be pinged every n seconds. This can help proxy servers which close idle connections, and it can detect if the websocket has failed without being properly closed. • websocket_ping_timeout: If the ping interval is set, and the server doesn’t receive receive a ‘pong’ in this many seconds, it will close the websocket. The default is three times the ping interval, with a minimum of 30 seconds. Ignored if the ping interval is not set. Authentication and0 码力 | 245 页 | 904.24 KB | 1 年前3
共 460 条
- 1
- 2
- 3
- 4
- 5
- 6
- 46