本文整理汇总了C++中Network::StartServer方法的典型用法代码示例。如果您正苦于以下问题:C++ Network::StartServer方法的具体用法?C++ Network::StartServer怎么用?C++ Network::StartServer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network
的用法示例。
在下文中一共展示了Network::StartServer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleStartServer
void SceneReplication::HandleStartServer(StringHash eventType, VariantMap& eventData)
{
Network* network = GetSubsystem<Network>();
network->StartServer(SERVER_PORT);
UpdateButtons();
}
示例2: HandleStartServer
void Chat::HandleStartServer(StringHash eventType, VariantMap& eventData)
{
Network* network = GetSubsystem<Network>();
network->StartServer(CHAT_SERVER_PORT);
UpdateButtons();
}
示例3: RunServer
void RunServer(unsigned short port, SocketTransportLayer transport)
{
// Start the server either in TCP or UDP mode.
server = network.StartServer(port, transport, this, true);
if (!server)
{
cout << "Unable to start server in port " << port << "!" << endl;
return;
}
cout << "Server waiting for connection in port " << port << "." << endl;
server->RunModalServer();
}
示例4: _tmain
int _tmain(int argc, _TCHAR* argv[])
{
//
#ifdef WIN32
WSADATA wsa_data;
WSAStartup(0x0202, &wsa_data);
#endif
MediaCreateSdp::GetInstance("\\test.h264");
struct sockaddr_in sa;
memset(&sa, 0, sizeof(sa));
sa.sin_family = AF_INET;
sa.sin_port = htons(1000);
sa.sin_addr.s_addr = htonl(0);
const char* ver = event_get_version();
printf("%s\n", ver);
Network* work = new Network(sa);
work->NetPrepare(TCP);
work->StartServer(MediaSession::Recv, MediaSession::Send);
//_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF);
return 0;
}