Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket Exception (Forbidden access) #125

Open
oisgrafika opened this issue Feb 6, 2023 · 27 comments
Open

Socket Exception (Forbidden access) #125

oisgrafika opened this issue Feb 6, 2023 · 27 comments
Labels
bug Something isn't working

Comments

@oisgrafika
Copy link

**
image
**
i get this error in windows

@Tienisto Tienisto added the bug Something isn't working label Feb 6, 2023
@itaowei
Copy link

itaowei commented Feb 23, 2023

image
Me too. Same error message...

@Tienisto
Copy link
Member

Tienisto commented Feb 23, 2023

(1) Try to start this app as admin
(2) Check in task manager if there is already another instance
(3) Use the latest version (v1.7.0) and check if this has been fixed

@itaowei
Copy link

itaowei commented Feb 25, 2023

(1) Try to start this app as admin (2) Check in task manager if there is already another instance (3) Use the latest version (v1.7.0) and check if this has been fixed

I am sure that I followed all of your steps but it still goes wrong.

@Tienisto Tienisto changed the title Socket Exception Socket Exception (Forbidden access) Feb 25, 2023
@Tienisto Tienisto pinned this issue Feb 25, 2023
@TheStar4Fate
Copy link

(1) Try to start this app as admin (2) Check in task manager if there is already another instance (3) Use the latest version (v1.7.0) and check if this has been fixed

Start with administrator privileges and still report an error

@hb-0
Copy link

hb-0 commented Mar 21, 2023

+1

@xuyisoso
Copy link

image Me too. Same error message...

me too
版本 Windows 10 专业版
版本号 21H2
安装日期 ‎2020/‎7/‎24
操作系统内部版本 19044.2075
体验 Windows Feature Experience Pack 120.2212.4180.0

@weijen6
Copy link

weijen6 commented May 7, 2023

Me too, but I changed the port to 52319 and successfully connected

@grypes
Copy link

grypes commented May 14, 2023

Same with @weijen6 , I changed the default port to another random port then it's working.

@Tienisto
Copy link
Member

Tienisto commented May 14, 2023

53317 seem to be a bad choice as there is a small probability that it is used as a "ephemeral port" (temporary port).

I guess a proper fix for this is to use a lower number port and use 53317 as fallback.

@grypes
Copy link

grypes commented May 14, 2023

Looks like this default port 53317 is reserved by Windows and other potential applications.
Below is the port reserved list of my runtime. (Windows 11 Pro 1000.22640.1000.0)

So any port in the below range will run into the same issue. In my case, I changed to 59998 and it works well.


> netsh interface ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port End Port
---------- --------
5357 5357
49675 49774
49875 49974
50000 50059 *
50060 50159
52683 52782
52814 52913
53287 53386
59865 59964
62040 62139
62140 62239
62240 62339
62340 62439
62440 62539
62540 62639
62640 62739

@zhaiyusci
Copy link

I have the same problem, but I find that the port 53317 is like blocked by localsend itself...
Using netstat -ano|findstr 53317 in cmd and I can find the PID of the process blocking the port, and right after that I killed it, localsend quitted.

@alisonjoe
Copy link

Phone2Mac:
DioError [unknown]: null
Error: SocketException: No route to host (OS Error: No route to host, errno = 113), address = 172.16.4.33, port = 39840

Mac2Phone:
DioError [connection timeout]: The request connection took longer than 720:00:00.000000. It was aborted.
Error: SocketException: Operation timed out (OS Error: Operation timed out, errno = 60), address = 172.16.221.61, port = 56128

@tintad
Copy link

tintad commented Jul 25, 2023

I had the same problem and fixed it by creating an inbound rule in Firewall settings for this app. It's working perfectly now
LocalSend

@user9931
Copy link

also on android tablet (oppo pad android 13, if means something) and dont have on other (huawei). no problem to specify manually, but...

@chenyi8920
Copy link

Me too, but I changed the port to 52319 and successfully connected

much appreciated!

@zeyios
Copy link

zeyios commented Nov 9, 2023

Changing to another port number like 52199 on both devices works for me.

@zhangj1164
Copy link

Looks like this default port 53317 is reserved by Windows and other potential applications. Below is the port reserved list of my runtime. (Windows 11 Pro 1000.22640.1000.0)

So any port in the below range will run into the same issue. In my case, I changed to 59998 and it works well.

netsh interface ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port End Port ---------- -------- 5357 5357 49675 49774 49875 49974 50000 50059 * 50060 50159 52683 52782 52814 52913 53287 53386 59865 59964 62040 62139 62140 62239 62240 62339 62340 62439 62440 62539 62540 62639 62640 62739

3Q,this is correct. I checked my TCP port Exclusion Ranges and it is different.

@BIgFish420
Copy link

(1) Try to start this app as admin
(2) Check in task manager if there is already another instance
(3) Use the latest version (v1.7.0) and check if this has been fixed

Very good keep up the good work

@BTBob53
Copy link

BTBob53 commented Dec 24, 2023

52319 worked for me

@mizzunet
Copy link

mizzunet commented Jan 3, 2024

I just faced this issue. But rebooting the system solved the same.

Anyway, for those still having this, try these https://www.thewindowsclub.com/error-10013-an-attempt-was-made-to-access-a-socket

@os9sur
Copy link

os9sur commented Feb 21, 2024

Me too.

Is it possible to automatically switch to a usable port when LocalSend runs?

@zznyjidi
Copy link

zznyjidi commented Mar 7, 2024

I had the same issue and I tried

net stop winnat

It works for me.
(Found at https://superuser.com/a/1610009)

@shzang
Copy link

shzang commented Mar 19, 2024

I had the same issue and I tried

net stop winnat

It works for me. (Found at https://superuser.com/a/1610009)

Thanks bro, after running this code, I can use port 53317 to transfer files normally.

@UnknownTI
Copy link

Me too, but I changed the port to 52319 and successfully connected

Me too. Thanks!

@sola97
Copy link

sola97 commented Mar 27, 2024

My Hyper-V VM dynamically used port 53317, causing Localsend to fail. I solved this by setting dynamic TCP ports to start above 60000 with the commands:

netsh int ipv4 set dynamic tcp start=60000 num=5535
netsh int ipv6 set dynamic tcp start=60000 num=5535

This avoids the port conflict by using higher numbered ports for dynamic allocation.

@angelicachao
Copy link

Just faced this issue as well, restarting Internet Connection Sharing from services fixed it immediately, didn't even need to restart localsend, was able to start the server from localsend's settings right away.

@flt6
Copy link

flt6 commented May 18, 2024

Looks like this default port 53317 is reserved by Windows and other potential applications. Below is the port reserved list of my runtime. (Windows 11 Pro 1000.22640.1000.0)

So any port in the below range will run into the same issue. In my case, I changed to 59998 and it works well.

netsh interface ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port End Port ---------- -------- 5357 5357 49675 49774 49875 49974 50000 50059 * 50060 50159 52683 52782 52814 52913 53287 53386 59865 59964 62040 62139 62140 62239 62240 62339 62340 62439 62440 62539 62540 62639 62640 62739

Same case for Win 10 22H2. 53291 53390 is reserved on my computer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests