Hello! I'm not quite sure I understand your project , so I made a video of a chat client socket that connects to a server made with Ruby. There are two ways to make a client and the most common is to create 2 threads , one for receiving messages from the server and the other thread to send messages to the server , the second way is to receive a message from the server and send a response , and repeating that cycle I did the second one is like you you sent in Ruby.
[login to view URL]
if you want the server in ruby have no problem to give it to you. Thank you for reading!