websocket/_abnf.py¶
The _abnf.py file
- class websocket._abnf.ABNF(fin=0, rsv1=0, rsv2=0, rsv3=0, opcode=1, mask=1, data='')[source]¶
ABNF frame class. See http://tools.ietf.org/html/rfc5234 and http://tools.ietf.org/html/rfc6455#section-5.2
- __init__(fin=0, rsv1=0, rsv2=0, rsv3=0, opcode=1, mask=1, data='')[source]¶
Constructor for ABNF. Please check RFC for arguments.
- static create_frame(data, opcode, fin=1)[source]¶
Create frame to send text, binary and other data.
- Parameters
data (<type>) – data to send. This is string value(byte array). If opcode is OPCODE_TEXT and this value is unicode, data value is converted into unicode string, automatically.
opcode (<type>) – operation code. please see OPCODE_XXX.
fin (<type>) – fin flag. if set to 0, create continue fragmentation.