Recently, I used localsend to send files, but I encountered the error System.Net.Sockets.SocketException (10013): An attempt was made to access a socket in a way that is not allowed by its access permissions
. I thought it was due to insufficient permissions, so I opened it with administrator privileges, but it didn't help.
After searching online, I found that the bug was caused by unavailable port numbers. First, let's check which ports are unavailable.
netsh interface ipv4 show excludedportrange protocol=tcp
Of course, the above image has already been fixed. There are mainly two solutions for the fix.
Solution 1#
Open the advanced settings of Localsend and change the port number to one that is not excluded. The downside is that other devices may not be able to scan it.
Method 2#
Turn off winnat and then turn it back on; this usually releases the ports. Remember to run with administrator privileges.
net stop winnat
netsh interface ipv4 show excludedportrange protocol=tcp
net start winnat
netsh interface ipv4 show excludedportrange protocol=tcp
Hey, it's working now.
This article is synchronized and updated to xLog by Mix Space. The original link is https://www.actorr.cn/notes/1