一个最简单的服务器程序
server.h
/**
* Server Class
*
* @author lichao
* @date 2019-08-07
* @copyleft GPL 2.0
*/
#ifndef __SERVER_H__
#define __SERVER_H__
namespace avdance {
class Server {
public:
Server(); //consrtuct
~Server(); //destruct
public:
void run();
};
} //namespace avdance
#endif //__SERVER_H__
server.cpp
/**
* the implement of Server Class
*
* @author lichao
* @date 2019-08-07
* @copyleft GPL 2.0
*/
#include <iostream>
#include <unistd.h>
#include "server.h"
namespace avdance {
Server::Server(){
std::cout << "Server construct..." << std::endl;
}
Server::~Server(){
std::cout << "Server destruct..." << std::endl;
}
void Server::run(){
while(1){
std::cout << "the server is runing..." << std::endl;
::usleep(1000000); //u
最后
以上就是忧虑毛巾最近收集整理的关于【WebRTC---进阶篇】(一)服务器基础编程一个最简单的服务器程序的全部内容,更多相关【WebRTC---进阶篇】(一)服务器基础编程一个最简单内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复