I’m currently working on solving the Protohackers Line Reversal Challenge and need some help with my approach, I’m implementing a solution where each connection is handled by a separate goroutine.
My idea is to check if a session already exists. If not, I’ll create a new one and launch a goroutine for that specific session. This means there will be a goroutine handling each connection., I’m using a single listener socket for reading and writing to the socket, How can I share this listener socket among different connection handlers (goroutines)? I’m a bit confused about how to manage this.