node/lib/metasm/metasm/os/remote.rb
def gdb_send(cmd, buf='')
		buf = cmd + buf
		buf = '$' << buf << '#' << gdb_csum(buf)
		log "gdb_send #{buf.inspect}" if $DEBUG

		5.times {
			@io.write buf
			out = ''
			loop do
				break if not IO.select([@io], nil, nil, 0.2)
				raise Errno::EPIPE if not ack = @io.read(1)
				case ack
				when '+'
					return true
				when '-'
					log "gdb_send: ack neg" if $DEBUG
					break
				when nil
					return
				else
					out << ack
				end
			end
			log "no ack, got #{out.inspect}" if out != ''
		}

		log "send error #{cmd.inspect} (no ack)"
		false
	end
# send the buffer, waits ack
# return true on success
send the buffer, waits ack
return true on success
send the buffer waits ack return true on success
def gdb_send(cmd, buf='')
		buf = cmd + buf
		buf = '$' << buf << '#' << gdb_csum(buf)
		log "gdb_send #{buf.inspect}" if $DEBUG
		5.times {
			@io.write buf
			out = ''
			loop do
				break if not IO.select([@io], nil, nil, 0.2)
				raise Errno::EPIPE if not ack = @io.read(1)
				case ack
				when '+'
					return true
				when '-'
					log "gdb_send: ack neg" if $DEBUG
					break
				when nil
					return
				else
					out << ack
				end
			end
			log "no ack, got #{out.inspect}" if out != ''
		}
		log "send error #{cmd.inspect} (no ack)"
		false
	end
def gdb_send ( cmd , buf = '' ) buf = cmd + buf buf = '$' << buf << '#' << gdb_csum ( buf ) log "gdb_send #{buf.inspect}" if $DEBUG 5 . times { @io . write buf out = '' loop do break if not IO . select ( [ @io ] , nil , nil , 0.2 ) raise Errno :: EPIPE if not ack = @io . read ( 1 ) case ack when '+' return true when '-' log "gdb_send: ack neg" if $DEBUG break when nil return else out << ack end end log "no ack, got #{out.inspect}" if out != '' } log "send error #{cmd.inspect} (no ack)" false end
send the buffer, waits ack
return true on success
send the buffer waits ack return true on success
cmd
buf