chronoxor / NetCoreServer

Ultra fast and low latency asynchronous socket server & client C# .NET Core library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution
https://chronoxor.github.io/NetCoreServer
MIT License
2.63k stars 550 forks source link

How to Choose an Ethernet Adapter #266

Closed GGorany closed 1 year ago

GGorany commented 1 year ago

I envision a test simulation like the one below.

  1. Multiple USBtoEthernet Adapters.
  2. One Client for each USBtoEthernet Adapter.
  3. Client is TcpClient using netcoreServer.

So, I want to select USBtoEthernet Adapter through netcoreServer.

I mean I'm asking how to set LocalEndPont.

I would really appreciate it if you could let me know if there is any way.

akanwischer commented 1 year ago

Extend the tcp client, override CreateSocket and bind your socket to your interface via Socket.Bind. Alternatively, use a search engine of your choice.

GGorany commented 1 year ago

Extend the tcp client, override CreateSocket and bind your socket to your interface via Socket.Bind. Alternatively, use a search engine of your choice.

I wanted to solve the problem without modifying the TCP Client library. Thank you so much.

akanwischer commented 1 year ago

But CreateSocket has protected as access modifier for a reason ;)