Beispiel #1
0
func main() {
	flag.Parse()
	if !*showLogs {
		log.SetOutput(ioutil.Discard)
	}
	lspnet.SetClientReadDropPercent(*readDrop)
	lspnet.SetClientWriteDropPercent(*writeDrop)
	params := &lsp.Params{
		EpochLimit:  *epochLimit,
		EpochMillis: *epochMillis,
		WindowSize:  *windowSize,
	}
	hostport := lspnet.JoinHostPort(*host, strconv.Itoa(*port))
	fmt.Printf("Connecting to server at '%s'...\n", hostport)
	cli, err := lsp.NewClient(hostport, params)
	if err != nil {
		fmt.Printf("Failed to connect to server at %s: %s\n", hostport, err)
		return
	}
	runClient(cli)
}
func (ts *windowTestSystem) setClientWriteDropPercent(percent int) {
	ts.t.Logf("Client write drop percent set to %d%%", percent)
	lspnet.SetClientWriteDropPercent(percent)
}