We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c4aadf commit 6ed3f79Copy full SHA for 6ed3f79
examples/echo.c3
@@ -33,6 +33,12 @@ fn void main() {
33
usz n = client_sock.read(buf)!!;
34
if (n == 0) break OUTER;
35
char[] chunk = buf[0:n];
36
+
37
+ if (((String)chunk).trim() == "quit") {
38
+ io::printfn("[%d] Client requested to quit", coroutine::id(), chunk.len);
39
+ return;
40
+ }
41
42
io::printfn("[%d] Client sent %d bytes", coroutine::id(), chunk.len);
43
44
while (chunk.len > 0) {
0 commit comments