Is mono / linux disabled?

I am using alchemy websockets and understood enough to get something working on windows. I built an alchemy on linux (ubuntu) with mono and started my server. It gets a socket error. Port → 1k (port 8005, to be precise)

Unhandled Exception: System.Net.Sockets.SocketException: Access denied at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00000] in <filename unknown>:0 at System.Net.Sockets.TcpListener.Start (Int32 backlog) [0x00000] in <filename unknown>:0 at System.Net.Sockets.TcpListener.Start () [0x00000] in <filename unknown>:0 at Alchemy.TcpServer.Listen (System.Object state) [0x00000] in <filename unknown>:0 

From the file name, it looks like I forgot to build using debugging information or did not install characters, but I successfully worked on mono. Its use of .NET 4.0 mono 2.10

Why am I accessing a ban on sockets?

+2
source share
2 answers

Few things to check

netstat -a | grep 8005 netstat -a | grep 8005 See if something else uses port 8005

Run as su to see if there is a resolution problem

sudo mono YourProgram.exe

I didn’t look very well at the library you are using, but if it uses ICMP or Raw Sockets, it should run as root.

Another thing to watch out for is checking to see if your DNS resolution matches. Standby sandboxes usually only complain about it, but I saw strange things happen and you did not give us a lot of information to continue.

If this is a root problem, and not that another program is using port 8005, you can leave using setcap in a monobyne, so you do not need to run it as root.

Run this as root: setcap cap_net_raw=iep /path/to/mono

+2
source

As stated in Access Denied to Create Alchemy WebSocket on Linux / Mono

Alchemy issues a Flash policy file at 843 - try disabling flashsocketpolicy when creating an instance of your server.

0
source

Source: https://habr.com/ru/post/1433690/


All Articles