HeQihan

HeQihan

Fix the OS error of localsend

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

Screenshot 2024-09-30 164944.png
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.

Screenshot 2024-09-30 165635.png

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

Screenshot 2024-09-30 170241.png

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

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.