uvbook icon indicating copy to clipboard operation
uvbook copied to clipboard

multi-echo-server example did not close connection

Open arifsetiawan opened this issue 9 years ago • 1 comments

Hi,

First, thanks a lot for the book and examples, really useful.

If I run tcp-echo-server and use netcat to test, connection is closed immediately

[root@375f8431ca9f code]# echo -n 'hello!' | nc 127.0.0.1 7000
hello![root@375f8431ca9f code]# 

however, if I run multi-echo-server the connection is not closed

[root@375f8431ca9f code]# echo -n 'hello!' | nc 127.0.0.1 7000
hello!

Is this expected behavior because of using child process?

arifsetiawan avatar Feb 19 '16 08:02 arifsetiawan

Excellent question. I'm not sure what is the reason. It should not be due to the different architecture because the main process just sends the socket FD to the worker.

nikhilm avatar Apr 20 '16 19:04 nikhilm