This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "socket" | |
socket = TCPSocket.open("localhost", 6666) | |
loop do | |
input = gets.chomp #Ask client for command | |
socket.puts input # Send command to server | |
line = socket.gets #Get server response | |
puts line |
OlderNewer