xaya / libxayagame

MIT License
21 stars 20 forks source link

Revert TcpServer to HttpServer #31

Closed RyuMaster closed 5 years ago

RyuMaster commented 5 years ago

A while ago, I asked to introduce TCP server support for Windows:

case RpcServerType::TCP:
      CHECK (config.GameRpcPort != 0)
          << "GameRpcPort must be specified for TCP server type";
      LOG (INFO)
          << "Starting JSON-RPC TCP server at port " << config.GameRpcPort;
      return std::make_unique<jsonrpc::TcpSocketServer> ("127.0.0.1",
                                                         config.GameRpcPort);
    }

After many test I found it to be extremely unstable. Then I found out, then if using jsonr-rpc-cpp 0.7.0, HttpServer works fine out-of-the-box for Windows. So please, when there is a chance, revert TcpSocketServer back to HttpServer, as it was before.

domob1812 commented 5 years ago

This is just an option - is it actually creating problems to have this option in the code? You can just specify that you want the HTTP server anyway.

However, supporting the TCP server means that jsonrpccpp has to be built from source as the Debian package does not include TCP support. So perhaps that's a good reason to revert the change.

RyuMaster commented 5 years ago

Yes, it creates a problem, because for Windows I need to use older 0.7 version, where we have no TCP headers

domob1812 commented 5 years ago

Ok - then I'll get rid of it again.