mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Client: server port and testing options cleanup
Now we only pass port as ui16 instead of std::string
This commit is contained in:
@@ -61,14 +61,14 @@ void CConnection::init()
|
||||
iser.fileVersion = SERIALIZATION_VERSION;
|
||||
}
|
||||
|
||||
CConnection::CConnection(std::string host, std::string port, std::string Name)
|
||||
CConnection::CConnection(std::string host, ui16 port, std::string Name)
|
||||
:iser(this), oser(this), io_service(new asio::io_service), name(Name)
|
||||
{
|
||||
int i;
|
||||
boost::system::error_code error = asio::error::host_not_found;
|
||||
socket = new tcp::socket(*io_service);
|
||||
tcp::resolver resolver(*io_service);
|
||||
tcp::resolver::iterator end, pom, endpoint_iterator = resolver.resolve(tcp::resolver::query(host,port),error);
|
||||
tcp::resolver::iterator end, pom, endpoint_iterator = resolver.resolve(tcp::resolver::query(host, boost::lexical_cast<std::string>(port)),error);
|
||||
if(error)
|
||||
{
|
||||
logNetwork->errorStream() << "Problem with resolving: \n" << error;
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
|
||||
bool receivedStop, sendStop;
|
||||
|
||||
CConnection(std::string host, std::string port, std::string Name);
|
||||
CConnection(std::string host, ui16 port, std::string Name);
|
||||
CConnection(TAcceptor * acceptor, boost::asio::io_service *Io_service, std::string Name);
|
||||
CConnection(TSocket * Socket, std::string Name); //use immediately after accepting connection into socket
|
||||
|
||||
|
||||
Reference in New Issue
Block a user