Skip to content

Instantly share code, notes, and snippets.

@felipeelias
Created May 11, 2011 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipeelias/966469 to your computer and use it in GitHub Desktop.
Save felipeelias/966469 to your computer and use it in GitHub Desktop.
Ping the Redis server using a TCP socket
require 'socket'
@socket = TCPSocket.new('127.0.0.1', 6379)
@socket.write("PING\r\n")
puts @socket.gets # => "+PONG"
@socket.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment