vendor/bundle/ruby/1.8/gems/Ruby-MemCache-0.0.1/lib/memcache.rb
def socket

			# Connect if not already connected
			unless @sock || (!@sock.nil? && @sock.closed?)

				# If the host was dead, don't retry for a while
				if @retry
					return nil if @retry > Time::now
				end

				# Attempt to connect, 
				begin
					@sock = timeout( ConnectTimeout ) {
						TCPSocket::new( @host, @port )
					}
					@status = "connected"
				rescue SystemCallError, IOError, TimeoutError => err
					self.mark_dead( err.message )
				end
			end

			return @sock
		end
### Try to connect to the memcached targeted by this object. Returns the
### connected socket object on success; sets @dead and returns +nil+ on
### any failure.
Try to connect to the memcached targeted by this object. Returns the
connected socket object on success; sets @dead and returns +nil+ on
any failure.
Try to connect to the memcached targeted by this object . Returns the connected socket object on success ; sets @dead and returns + nil + on any failure .
def socket
			unless @sock || (!@sock.nil? && @sock.closed?)
				if @retry
					return nil if @retry > Time::now
				end
				begin
					@sock = timeout( ConnectTimeout ) {
						TCPSocket::new( @host, @port )
					}
					@status = "connected"
				rescue SystemCallError, IOError, TimeoutError => err
					self.mark_dead( err.message )
				end
			end
			return @sock
		end
def socket unless @sock || ( ! @sock . nil? && @sock . closed? ) if @retry return nil if @retry > Time :: now end begin @sock = timeout ( ConnectTimeout ) { TCPSocket :: new ( @host , @port ) } @status = "connected" rescue SystemCallError , IOError , TimeoutError => err self . mark_dead ( err . message ) end end return @sock end
Try to connect to the memcached targeted by this object.
Try to connect to the memcached targeted by this object .
# Connect if not already connected # If the host was dead, don't retry for a while # Attempt to connect, 