getnamo / TCP-Unreal

Convenience TCP wrapper for Unreal Engine
MIT License
106 stars 36 forks source link

How to disconnect ? #8

Open longlong10086 opened 2 years ago

longlong10086 commented 2 years ago

I tried the tcp server , at begin it worked well , after a momnet...

I failed to connect to the server ,and I find some connections (state likely close-wait,fin_wait,time-wait...) .

When should I disconnect ? And how to use in the event grah? Could it reconnect when disconnected to ensure normal communication ?

Looking forward to more detailed documentation . -_-

getnamo commented 2 years ago

You can try CloseSocket on the client tcp component https://github.com/getnamo/tcp-ue4/blob/master/Source/TCPWrapper/Public/TCPClientComponent.h#L66 or StopListenServer on server component https://github.com/getnamo/tcp-ue4/blob/master/Source/TCPWrapper/Public/TCPServerComponent.h#L99

TCP doesn't reconnect automatically if disconnected, if you want a more fully featured network pipe consider https://github.com/getnamo/socketio-client-ue4