lib/rawjsonrpc/server.rb in rawjsonrpc-0.1.2 vs lib/rawjsonrpc/server.rb in rawjsonrpc-0.1.3

- old
+ new

@@ -56,17 +56,17 @@ else @rawjsonrpc_back = request_data raise("No Methode") end if request_data["id"] != nil - response_data = {"result" => ret, "error" => nil, "id" => request_data["id"]} + {"result" => ret, "error" => nil, "id" => request_data["id"]} .to_json else nil end rescue => ex unless @rawjsonrpc_noti - response = {"result" => nil, "error" => ex.message, + {"result" => nil, "error" => ex.message, "id" => @rawjsonrpc_id}.to_json end end end end @@ -87,11 +87,11 @@ logger.call(para) end end public # Starts the servering the methods for clients - def server - check log.level, "start serving data at " + @port.to_s + def serve + check @log, "start serving data at " + @port.to_s server = TCPServer.new(@port) client = server.accept loop do begin data = client.gets