Skip to content

add example of tcp hook

trinity-1686a requested to merge trinity-1686a/arti:custom-tcp-hook into main

Following discussions on IRC today, this is an example of a program logging on tcp connect/disconnect.

Outside of the example itself, it required making some TLS related types public so they can be composed into a runtime.

I realize while writing this that the close part is not 100% correct as tcp allow for half closed connections. I'll make changes tomorrow so it consider closed when poll_close() is called on our side, and a zero length read happened. done

While trying to test the closing connection part, I noticed there is no way to close an ArtiClient. Even while dropped, things still seems to happen in the background. Maybe a ArtiClient::close could/should exists?

Edited by trinity-1686a

Merge request reports

Loading