# File lib/rfuzz/client.rb, line 376 376: def send_request(method, uri, req) 377: begin 378: notify :connect do 379: @sock = PushBackIO.new(TCPSocket.new(@host, @port)) 380: end 381: 382: out = StringIO.new 383: body = build_request(out, method, uri, req) 384: 385: notify :send_request do 386: @sock.write(out.string + body) 387: @sock.flush 388: end 389: 390: return read_response 391: rescue Object 392: raise $! 393: ensure 394: if @sock 395: notify(:close) { @sock.close } 396: end 397: end 398: end