网络应用案例与安全通信指南
聊天客户端构建
在构建聊天客户端时,我们需要处理一系列的消息,并适时重启定时器以确保消息的持续处理。以下是相关代码示例:
str = cmd.op1 + " has left the room.\n";
chatEdit->append(str.c_str());
}
}
}
After we process all of the pending messages, we start the timer again.
theTimer->start(250, true);
}
构建聊天客户端还需要使用Makefile来进行编译,以下是具体的Makefile内容:
CC = g++
INCDIR = -I $(QTDIR)/include
LDFLAGS = -L $(QTDIR)/lib -lqt-mt
all: chatcli
chatcli: chatcli.o chatwin.o logindlg.o
moc_chatwin.o moc_logindlg.o
$(CC) -o chatcli $(LDFLAGS) chatcli.o chatwin.o logindlg.o moc_chatwin.o \
moc_logindlg.o
chatcli.o: chatcli.cpp
$(CC) -c $(INCDIR) chatcli.cpp
chatwin.o: chatwin.cpp chatwin.h moc_chatwin.cpp
$(CC) -c $(INCDIR) c
超级会员免费看
订阅专栏 解锁全文
3328

被折叠的 条评论
为什么被折叠?



