-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closing UTP server takes a long time #40
Comments
And this isn't really mentioned in the docs. But if I close the server while there are on-going connections, does the server automatically trigger the destruction of those connections? Or is just going to hang forever? If so, I will need to go to each connection and destroy them right? |
Yea you need to destroy each socket yourself similarly to a tcp server in node |
Every connection has been destroyed before I try to close the utp server. Is there some special trick to do so to hurry up the closing of the utp server?
…On 13 May 2021 2:40:22 am AEST, Mathias Buus ***@***.***> wrote:
Yea you need to destroy each socket yourself similarly to a tcp server
in node
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#40 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
Can you share an example perhaps?
… On 13 May 2021, at 02.25, Roger Qiu ***@***.***> wrote:
Every connection has been destroyed before I try to close the utp server. Is there some special trick to do so to hurry up the closing of the utp server?
On 13 May 2021 2:40:22 am AEST, Mathias Buus ***@***.***> wrote:
>Yea you need to destroy each socket yourself similarly to a tcp server
>in node
>
>--
>You are receiving this because you authored the thread.
>Reply to this email directly or view it on GitHub:
>#40 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Well it's in a particular test case in our project js-polykey. Specifically this test case: https://github.com/MatrixAI/js-polykey/blob/nodes-refactoring/tests/network/ForwardProxy.test.ts#L138 |
In my tests I'm creating 2 UTP sockets, one as the client socket and the other as the UTP server. I've found that if I destroy all UTP connections, and then immediately close the client socket, this causes problems in closing the UTP server. But if I wait 5 seconds before closing the client socket, the UTP server closes fine. These tests are all running within 1 process. Perhaps there's some issue with running multiple UTP sockets on the same process? Or there is a problem if I were to close a UTP socket immediately after closing the the UTP connections? |
PR a test case, and we'll take a look :) |
I've currently resolved this by doing:
That way I'm not waiting for the socket to finish. Also prior to this, I have to close all connections and also wait 1 second for utp to flush any buffers. |
After setting up a server and performing 1 successful connection with it, as soon as that connection is ended and destroyed, I try to close the UTP server, and it just hangs for about 20 to 25 seconds before it finishes.
I may have some UTP packets in the send buffer, but what are the expected amount of time taken for shutting down the UTP server since all connections have been destroyed.
The text was updated successfully, but these errors were encountered: