You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are the Socket methods Send or SendTo thread-safe, i.e. can be used in a re-entrant manner similar to HttpClient.SendAsync and co, in order to "to send multiple messages to the same server" ?
Our use is for StatsD, sending data over Ip or Udp.
If yes it is thread-safe, then the docs don't mention that, and they should.
If not, then we could also use a fast thread-safe socket pool instead.
im used TCP and tested the Socket.Disconnect(true); API on windows its very stupid.
its will blocked call and take about 2 mins;
and im tried modify the Regedit path HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
Added TcpTimedWaitDelay and set to 30,no effect.
For Language competitive, performance is so important.
how socket performance will better at .net core 3.0 or 5.0
I found some of my concerns and issues you mention are not the same.
your's is reuse the connection.
my's is reuse the socket object(include handle and kernel's resources)
tested the Socket.Disconnect(true); API on windows its very stupid.
its will blocked call and take about 2 mins;
@sgf, I'm not clear on what your comments have to do with this issue. If you're facing what you believe is a performance issue with Disconnect, please open a new issue specific to that, including a repro we can run to see the behavior you discuss. Thanks.
tested the Socket.Disconnect(true); API on windows its very stupid.
its will blocked call and take about 2 mins;
@sgf, I'm not clear on what your comments have to do with this issue. If you're facing what you believe is a performance issue with Disconnect, please open a new issue specific to that, including a repro we can run to see the behavior you discuss. Thanks.
Triage: We do not think we need this type of API without clear customer demand and benefit. It can be built on top of our APIs if needed. If it proves to be super-popular, we can always reconsider adopting it into the platform.
Activity
svick commentedon May 26, 2018
Do I understand it correctly that this applies to scenarios where all of the following apply?
felipepessoto commentedon May 26, 2018
Exactly
karelz commentedon May 27, 2018
I wonder if such kind of pooling would be better to be done on top of Sockets - similar way SocketsHttpClient does it.
AnthonySteele commentedon Jul 16, 2018
Are the
SocketmethodsSendorSendTothread-safe, i.e. can be used in a re-entrant manner similar toHttpClient.SendAsyncand co, in order to "to send multiple messages to the same server" ?Our use is for StatsD, sending data over Ip or Udp.
If yes it is thread-safe, then the docs don't mention that, and they should.
If not, then we could also use a fast thread-safe socket pool instead.
edit : No, sockets don't seem to be thread-safe.
sgf commentedon Jul 12, 2019
im used TCP and tested the Socket.Disconnect(true); API on windows its very stupid.
its will blocked call and take about 2 mins;
and im tried modify the Regedit path HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
Added TcpTimedWaitDelay and set to 30,no effect.
For Language competitive, performance is so important.
how socket performance will better at .net core 3.0 or 5.0
sgf commentedon Jul 12, 2019
I found some of my concerns and issues you mention are not the same.
your's is reuse the connection.
my's is reuse the socket object(include handle and kernel's resources)
stephentoub commentedon Jul 13, 2019
@sgf, I'm not clear on what your comments have to do with this issue. If you're facing what you believe is a performance issue with Disconnect, please open a new issue specific to that, including a repro we can run to see the behavior you discuss. Thanks.
sgf commentedon Jul 13, 2019
i will do that,open new issue for the Disconnect.
karelz commentedon Sep 9, 2019
Triage: We do not think we need this type of API without clear customer demand and benefit. It can be built on top of our APIs if needed. If it proves to be super-popular, we can always reconsider adopting it into the platform.