MCPcopy
hub / github.com/tornadoweb/tornado / handle_stream

Method handle_stream

tornado/test/concurrent_test.py:81–89  ·  view source on GitHub ↗
(self, stream, address)

Source from the content-addressed store, hash-verified

79class CapServer(TCPServer):
80 @gen.coroutine
81 def handle_stream(self, stream, address):
82 data = yield stream.read_until(b"\n")
83 data = to_unicode(data)
84 if data == data.upper():
85 stream.write(b"error\talready capitalized\n")
86 else:
87 # data already has \n
88 stream.write(utf8("ok\t%s" % data.upper()))
89 stream.close()
90
91
92class 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