NetCoreServer
NetCoreServer copied to clipboard
Add session last read and write activity timestamps
After discussion in https://github.com/chronoxor/NetCoreServer/issues/98 it was concluded, that adding dangling connections detection is out of scope of core library and should be implemented in application layer.
To implement detection of idling connections, checking session last activity is required.
It would be helpful to have LastBytesReceived
that shows DateTime
of last bytes received and LastBytesSent
that shows DateTime
of last bytes sent fields in TcpSession
, SslSession
to easily check when was last IO operation executed in particular session so they could be checked against idling session logic.
I could prepare PR if @chronoxor agrees with this.
@chronoxor what do you think about this suggestion?
I think this can be easily done in your code by inheriting onSend()/onReceive() methods in TcpSession/SslSession.
I'll try to implement it in base sessions soon.