TCP
client -> 1.初始化套接字 -> 2.连接 -> 数据收发
server -> 1.初始化套接字 -> 2.绑定 -> 3.监听 -> 4.接收客户端连接 -> 数据收发
client:
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <pthread.h>
// 函数声明
void *ThreadRecvData(void *);
char *GetTimeHMS();
// 主线程
int main(int argc, char **argv){
int sockfd; // 存储套接字
pthread_t pt;
unsigned short dft_port = 60000;
struct sockaddr_in server_info; // 存储服务端协议地址信息
char buffer[1024] = {0};
char *server_ip;
if( argc < 2 ){
fprintf(stderr, "<usage>