网络应用案例与安全通信
一、聊天客户端构建
在构建聊天客户端时,我们需要处理消息并重新启动定时器。以下是相关代码片段:
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 来构建聊天客户端:
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) chatwin.cpp
moc_chatwin.o: moc_chat
超级会员免费看
订阅专栏 解锁全文
1万+

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



