We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
out := bytes.NewBuffer(nil) var buffer bytes.Buffer var p []byte var crlfBuffer [2]byte = [2]byte{'\r','\n'} crlf := crlfBuffer[:] time.Sleep(1 * time.Second) var readBuffer [2]byte readP := readBuffer[1:] for { fmt.Println("telnet_cmd.go 111111111111") n, err := c.dataReader.Read(readP) fmt.Println("telnet_cmd.go 22222222222222") if n <= 0 && nil == err { continue } else if n <= 0 && nil != err { break } LongWrite(out, readP) if (readBuffer[0] == '#' || readBuffer[0] == ':') && readBuffer[1] == ' ' { break } readBuffer[0] = readBuffer[1] } for _, cmd := range []string{user, pwd} { buffer.Write([]byte(cmd)) buffer.Write(crlf) p = buffer.Bytes() n, err := LongWrite(c.dataWriter, p) if nil != err { break } if expected, actual := int64(len(p)), n; expected != actual { fmt.Printf("Transmission problem: tried sending %d bytes, but actually only sent %d bytes. \n ", expected, actual) return fmt.Errorf("Transmission problem: tried sending %d bytes, but actually only sent %d bytes. \n ", expected, actual) } buffer.Reset() for { n, err := c.dataReader.Read(readP) if n <= 0 && nil == err { continue } else if n <= 0 && nil != err { break } LongWrite(out, readP) if (readBuffer[0] == '#' || readBuffer[0] == ':') && readBuffer[1] == ' ' { break } readBuffer[0] = readBuffer[1] } } time.Sleep(3 * time.Millisecond) return nil }``` when i login it will block in ` fmt.Println("telnet_cmd.go 111111111111") n, err := c.dataReader.Read(readP) fmt.Println("telnet_cmd.go 22222222222222") ` my develop environment is win10 Anyone konw why? thanks
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: