linux-cpp-chatroom/Experiment_5/test_server.cpp

7 lines
380 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "server.h"
int main()
{
server serv(8023, "127.0.0.1"); // 创建了一个名为serv的服务器对象该对象的构造函数参数分别为服务器的端口号8023和IP地址"127.0.0.1",表示要监听的服务器的地址和端口
serv.run(); // 调用了serv对象的run函数开始执行服务器程序并等待客户端连接
}