Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ensure we aren't sharing sockets across processes

Adds a check to see if the pid that connected to kestrel is the same as the
current pid.
  • Loading branch information...
commit 19e98b0e2e17711283cb247331c0962ce63b419d 1 parent 873737e
@eric eric authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/kjess/connection.rb
View
5 lib/kjess/connection.rb
@@ -32,8 +32,11 @@ def initialize( host, port = 22133 )
#
# Returns a TCPSocket
def socket
+ close if @pid && @pid != Process.pid
return @socket if @socket and not @socket.closed?
- return @socket = connect()
+ @socket = connect()
+ @pid = Process.pid
+ return @socket
end
# Internal: Create the socket we use to talk to the Kestrel server
Please sign in to comment.
Something went wrong with that request. Please try again.