in reply to Cannot determine peer address

Look at do_child and handle_connection. You accept a new connection, read one line, write one line, then close the connection. Exactly what you see on the client side.