-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Setting the deadline here:
Line 207 in d54e7db
| c.SetReadDeadline(time.Now().Add(time.Microsecond)) |
Seems to cause issues if you try to do something like this:
func telnetHandler(c *telnet.Connection) {
log.Printf("Connection received: %s", c.RemoteAddr())
c.Write([]byte("Connected!\r\n"))
var b []byte = make([]byte, 1)
for {
log.Println("reading a byte")
_, err := c.Read(b)
if err != nil {
log.Error("error reading from telnet client: ", err)
log.Error("closing socket")
return
}
log.Println("character received: ", string(b))
}
}For my application, I need to read 1 character at a time and the deadline code seems to time out the Read(). Removing the deadline resolves the issue for me.
Metadata
Metadata
Assignees
Labels
No labels