(self, first=False, last=False, mask=False)
return Frame(body=self.data,
                     opcode=opcode, masking_key=mask,
                     fin=fin).build()
Returns a :class:`ws4py.framing.Frame` bytes.

        The behavior depends on the given flags:

        * ``first``: the frame uses ``self.opcode`` else a continuation opcode
        * ``last``: the frame has its ``fin`` bit set
        * ``mask``: the frame is masked using a automatically generated 4-byte token
Returns a :class:`ws4py.framing.Frame` bytes.
Returns a : class : ws4py . framing . Frame bytes .
def fragment(self, first=False, last=False, mask=False):
        """
        Returns a :class:`ws4py.framing.Frame` bytes.

        The behavior depends on the given flags:

        * ``first``: the frame uses ``self.opcode`` else a continuation opcode
        * ``last``: the frame has its ``fin`` bit set
        * ``mask``: the frame is masked using a automatically generated 4-byte token
        """
        fin = 1 if last is True else 0
        opcode = self.opcode if first is True else OPCODE_CONTINUATION
        mask = os.urandom(4) if mask else None
        return Frame(body=self.data,
                     opcode=opcode, masking_key=mask,
                     fin=fin).build()
def fragment ( self , first = False , last = False , mask = False ) : fin = 1 if last is True else 0 opcode = self . opcode if first is True else OPCODE_CONTINUATION mask = os . urandom ( 4 ) if mask else None return Frame ( body = self . data , opcode = opcode , masking_key = mask , fin = fin ) . build ( )