I'm now using a socket server in C# but I can only bind it to 127.0.0.1. But it has to bind to my VPS IP. Even if I try to bind to my hamachi IP, it doesn't work.
I use:
ServerSocketSettings Settings = new ServerSocketSettings
{
MaxConnections = Config.ServerMaxConnections,
NumOfSaeaForRec = Config.ServerMaxConnections,
Backlog = 30,
MaxSimultaneousAcceptOps = 15,
BufferSize = 512,
Endpoint = new IPEndPoint(IPAddress.Parse("25.168.77.190"), Config.ServerPort)
};
this._serverSocket = new ServerSocket(Settings);
Then I do:
this.ListenSocket = new Socket(this.Settings.Endpoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
this.ListenSocket.Bind(this.Settings.Endpoint);
this.ListenSocket.Listen(this.Settings.Backlog);
the this.Settings is the value of the code above. When I run it, I get:
The requested address is not valid in its context
I'm wondering why it doesn't work.