MCPcopy Create free account
hub / github.com/EasyIME/PIME / handle_stream

Method handle_stream

python/python3/tornado/test/concurrent_test.py:56–64  ·  view source on GitHub ↗
(self, stream, address)

Source from the content-addressed store, hash-verified

54class CapServer(TCPServer):
55 @gen.coroutine
56 def handle_stream(self, stream, address):
57 data = yield stream.read_until(b"\n")
58 data = to_unicode(data)
59 if data == data.upper():
60 stream.write(b"error\talready capitalized\n")
61 else:
62 # data already has \n
63 stream.write(utf8("ok\t%s" % data.upper()))
64 stream.close()
65
66
67class CapError(Exception):

Callers

nothing calls this directly

Calls 6

to_unicodeFunction · 0.90
utf8Function · 0.90
read_untilMethod · 0.80
upperMethod · 0.80
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected