Skip to content

Instantly share code, notes, and snippets.

@prem
prem / sockets.rb
Created August 28, 2008 00:52 — forked from dyoder/sockets.rb
require 'socket'
require 'rubygems'
require 'monitor'
include Socket::Constants
class YPCSocket
def initialize( port, ip )
@socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
@address = Socket.pack_sockaddr_in( port, ip )