Code:
class ConnectionHandler
puts "Connection_Handler(threading.Thread) -> Handle Connections For RS-CSC"
puts " "
puts " "
connectedList = []
def __run_();
puts "Connection_Handler.run() -> Overides run method for thread __init__"
puts " "
puts " "
try
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind('', 43594)
rescue
puts "can not start server!"
else;
#server loop
server.listen(1)
while true:
channel, details = Server.accept() #Accept Connection
puts details + "has connected!"
self.connectedQuene.append(details)
buffer = channel.recv(850)
puts buffer
self.connectedList.pop()
__run__ = staticmethod(__run__)
Connection_Handler.__run__()
end
end
end
I got bored, yes. Also i based this off of theifmans connection handler in python.