⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tcp.c

📁 飞鸽传书的linux源代码
💻 C
字号:
#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <sys/socket.h>#include <netinet/in.h>#include <netdb.h>#include <errno.h>#include <glib.h>#include <unistd.h>#include "common.h"static intdestroy_tcp_connection(tcp_con_t *con) {  if (!con)    return -EINVAL;  if (con->self)    freeaddrinfo(con->self);  close(con->soc);  return 0;}static intparse_request(request_msg_t *req,const char *request_string){  size_t len;  long int_val;  char *sp=NULL;  char *ep=NULL;  char *buffer;  ssize_t remains;  int rc=0;  if  ( (!request_string) || (!req) )    return -EINVAL;  buffer=strdup(request_string);  if (!buffer)    return -ENOMEM;  len=strlen(request_string);  _assert(len>0);  remains=len;  /*   * 銉戙偙銉冦儓鐣

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -