2014-11-21 12:46:37 +08:00
|
|
|
/*
|
|
|
|
* gserver.cpp
|
|
|
|
*
|
|
|
|
* Created on: 2014-10-19
|
|
|
|
* Author: hanshuo
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include"../Server/Server.h"
|
2015-01-17 15:52:44 +08:00
|
|
|
#include<sstream>
|
2014-11-21 12:46:37 +08:00
|
|
|
|
|
|
|
int main(int argc, char * argv[])
|
|
|
|
{
|
2015-01-17 15:52:44 +08:00
|
|
|
unsigned short port = Socket::DEFAULT_CONNECT_PORT;
|
|
|
|
|
|
|
|
if (argc > 1)
|
|
|
|
{
|
|
|
|
std::stringstream ss(argv[1]);
|
|
|
|
ss >> port;
|
|
|
|
|
|
|
|
std::cout << "port=" << port << std::endl; //debug
|
|
|
|
}
|
|
|
|
|
|
|
|
Server server(port);
|
2014-11-21 12:46:37 +08:00
|
|
|
|
|
|
|
server.createConnection();
|
|
|
|
server.listen();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|