真心想学习的伙伴,需要库的朋友们请留言!
完整代码如下:
client.c
/*************************************************************************
File Name: client.c
Author: Young
motto: Continuous efforts will lead to a better future
Created Time: Sun 2 Sep 2018 10:00:05 CST
************************************************************************/
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/file.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <strings.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#define N 64
#define M 512
typedef struct //消息结构体
{
int type;
char name[N];
char data[M];
}MSG;
int n;
void help_l(); //帮助手册
void display_1(); //第一个界面显示
void display_2(); //查询界面显示
void display_3(int sockfd, MSG *msg); //查询界面函数
int login(int sockfd, MSG *msg); //登录函数

本文档介绍如何在Linux环境下进行TCP网络编程,以实现一个在线英英词典功能。示例提供了client.c的源代码,适合想学习网络编程的读者。
最低0.47元/天 解锁文章
2506





