reiver / go-telnet

Package telnet provides TELNET and TELNETS client and server implementations, for the Go programming language, in a style similar to the "net/http" library that is part of the Go standard library, including support for "middleware"; TELNETS is secure TELNET, with the TELNET protocol over a secured TLS (or SSL) connection.

Home Page:https://godoc.org/github.com/reiver/go-telnet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can the server detect conn is closed?

wangxiangyu opened this issue · comments

I send stream output to stdout in shellHandler. So when the conn is closed, I need to terminate the handler function. So How can the server detect conn is closed?

Thank you ~

I'm in the same situation where I want to be notified when a connection is open/closed.

I'm gong to fork your telsh implementation and try adding the following two methods to the shellHandler:

 shellHandler.RegisterConnectionOpen(producer Producer)
 shellHandler.RegisterConnectionClosed(producer Producer)

Also, I'm thinking this issue should be combined with #6. On that issue, I'll elaborate on an experiment I already did with telnet.Context to identify unique connections in the standard command handlers.