Performance issue with starting adapter client in tests #26
SergeyGulik
started this conversation in
General
Replies: 1 comment 1 reply
-
@SergeyGulik Thanks for bringing this up. Yes, based on the SO link you provided it looks like the change you proposed would solve the delay. I'll see if parsing the Server address before creating the TcpClient to determine whether it is IP4 or IP6 would be faster than the TcpClient attempting to determine it. Then we could just toggle the AddressFamily based on whether it is IP4 or IP6. I'll see if I can add something to fix this in the next release. Thanks, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Patrick,
I have not put this in issues, since it not at all an issue with the code, but there exists .NET behaviour that creates me a problem.
ShdrAdapterClient.cs, line ~162
// Create new TCP Client
_client = new TcpClient(Server, Port);
On every test run I experienced 2sec delay on this line.
I am not a network guy at all, but luckily I have found this excellent answer on SO: https://stackoverflow.com/a/49348416
When I changed code like
_client = new TcpClient(AddressFamily.InterNetwork); <-- this means IP4
_client.Connect(Server, Port);
2sec delay disappeared.
This is possible solution, but according to SO answer we may also bind server to listen locally for IP6 requests.
I have not tried it yet, but wonder what would you prefer.
Best regards,
Sergii.
Beta Was this translation helpful? Give feedback.
All reactions