gopl ch8 ex8.14, Go Chat server that allows client names

84 views
Skip to first unread message

Tong Sun

unread,
Jul 7, 2023, 6:28:32 PM7/7/23
to golang-nuts
For the chapter 8 of the book "The Go Programming Language":


The exercise 8.14 is about using names instead of network addresses to identify clients, and I'm having problem with how to implement it.

I searched for "answers/solutions" on the web, and found that all of them will prompt for keyboard input in the `handleConn` function, like this one:

However, my understanding is that

- the chat will be running as a (single) service in one machine, and
- all clients (from the localnet) will be chatting with `netcat3`

IE, I don't see how different clients from different machines will be prompted for keyboard input if they start chatting with `netcat3`. Is my such understanding correct please? (and what's the proper way of doing it if so)

thanks





Tong Sun

unread,
Jul 7, 2023, 11:56:44 PM7/7/23
to golang-nuts
Oh, please disregard my question -- I've figured it out.
Reply all
Reply to author
Forward
0 new messages