2. Sockets

Most Shrapnel programs make heavy use of sockets. The coro package implements its own socket class, which is nearly identical to the socket class in Python. Indeed, if you use coro.install_thread_emulation() then the socket class will be monkey-patched into Python’s socket module.

2.1. Creating Sockets

Though you are free to directly instantiate the coro.sock object, there are a variety of functions to assist in creating socket objects with a little more clarity.

2.2. Socket Classes

2.3. Socket Functions

The coro module offers the following functions related to sockets.

2.4. Socket Constants

The following classes provide a variety of constants often used with sockets.