Now I am using a socket server in C #, but I can only bind it to 127.0.0.1. But he has to contact my VPS IP. Even if I try to bind my Hamachi IP address, it does not 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);
this.Settings is the value of the above code. When I run it, I get:
The requested address is invalid in its context
I am wondering why this is not working.
source
share