go-telnet icon indicating copy to clipboard operation
go-telnet copied to clipboard

How can the server detect conn is closed?

Open wangxiangyu opened this issue 6 years ago • 1 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 ~

wangxiangyu avatar Jun 12 '18 08:06 wangxiangyu

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.

majgis avatar Jun 24 '18 18:06 majgis