2016-03-04 16:49:06 +08:00
|
|
|
/*=============================================================================
|
|
|
|
# Filename: gserver.cpp
|
|
|
|
# Author: Bookug Lobert
|
|
|
|
# Mail: 1181955272@qq.com
|
|
|
|
# Last Modified: 2016-02-26 19:15
|
|
|
|
# Description: first written by hanshuo, modified by zengli
|
|
|
|
=============================================================================*/
|
2014-11-21 12:46:37 +08:00
|
|
|
|
2015-11-06 19:13:39 +08:00
|
|
|
#include "../Server/Server.h"
|
|
|
|
#include "../Util/Util.h"
|
2014-11-21 12:46:37 +08:00
|
|
|
|
|
|
|
int main(int argc, char * argv[])
|
|
|
|
{
|
2015-11-06 19:13:39 +08:00
|
|
|
#ifdef DEBUG
|
|
|
|
Util util;
|
|
|
|
#endif
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
Server server(port);
|
2014-11-21 12:46:37 +08:00
|
|
|
|
2015-02-02 15:53:47 +08:00
|
|
|
std::cout << "port=" << port << std::endl; //debug
|
|
|
|
|
2014-11-21 12:46:37 +08:00
|
|
|
server.createConnection();
|
|
|
|
server.listen();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|