MCPcopy Create free account
hub / github.com/antirez/freakwan / write

Method write

networking.py:75–82  ·  view source on GitHub ↗
(self,data)

Source from the content-addressed store, hash-verified

73 # Write to the IRC server. Here we just do buffering. Actual writing
74 # is performing to flush_write_buffer().
75 def write(self,data):
76 if not self.connected: return
77 # If for some reason we can't flush the buffer to the socket, we
78 # are forced to discard it. Better to accumulate the last part
79 # of the buffer than the first one, so that it will contain more
80 # recent messages.
81 if len(self.wbuf) > 1024: self.wbuf = b''
82 self.wbuf += data
83
84 # Try to write our pending write buffer, if any. And leave
85 # the part we were not able to transfer to the socket still in the

Callers 4

replyMethod · 0.95
process_lineMethod · 0.95
registerMethod · 0.45
flush_write_bufferMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected