System.Net.Sockets.SocketException in ForwardedPortLocal.StartPort
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 993
- Avg merge
- 9d 21h
- Merged PRs (30d)
- 1
Description
I have a piece of code that more or less does this:
var forwardedPort = new ForwardedPortLocal("127.0.0.1", (uint)boundPort, "127.0.0.1", (uint)port);
SshClient?.AddForwardedPort(forwardedPort);
forwardedPort.Start();
I often get this exception:
System.Net.Sockets.SocketException (0x80004005): An attempt was made to access a socket in a way forbidden by its access permissions
at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at Renci.SshNet.ForwardedPortLocal.InternalStart()
at Renci.SshNet.ForwardedPortLocal.StartPort()
I wonder if there's anything that I could be doing wrong (doesn't seem at first sight) or if there's anything else going on.
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ForwardedPortLocal.StartPort() and InternalStart() stack frames, then reproduce the bind using the shown ForwardedPortLocal setup. Determine whether the failure comes from the requested local endpoint or library behavior; done means documenting the cause and providing a verified fix or regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100