![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
网络开发包
shao326
未婚
展开
-
各种字符集和编码详解(转)
各种字符集和编码详解(转) 在软件的编码和实现中,我们可能会碰到个 一个比较头疼的问题--编码,不同字符间的编码和解码,你确定了解各种字符的编码吗?一个朋友问到了我这个问题,我虽然能回答一两个出来,但是感觉已经有点模糊,混乱了,在网上搜了搜,在书上翻了翻,总结一下吧。首先按照字符编码的历程来看:1. ASCII 我们需要了解的最早编码是ASCII码。它用7个二进制位来表...2010-03-12 16:18:57 · 118 阅读 · 0 评论 -
tcp/ip 内核校验
头文件<asm/checksum.h>ip校验:ip_fast_csum(const void *iph, unsigned int ihl)__wsum csum_partial(const void *buff, int len, __wsum sum); static inline __sum16 csum_tcpudp_magic(__be32 ...原创 2010-09-06 19:44:40 · 740 阅读 · 0 评论 -
十进制转换为十六进制(C语言)
#include<stdio.h>//使用递归int cal(int i){ if(i!=0) { cal(i/16); if(i%16<10) printf("%d",i%16); else printf("%c",i%16+'a'-10); } else return 0;} ...原创 2010-09-06 16:54:36 · 531 阅读 · 1 评论 -
error while loading shared libraries --转
库文件在连接(静态库和共享库)和运行(仅限于使用共享库的程序)时被使用,其搜索路径是在系统中进行设置的。一般 Linux 系统把 /lib 和 /usr/lib 两个目录作为默认的库搜索路径,所以使用这两个目录中的库时不需要进行设置搜索路径即可直接使用。对于处于默认库搜索路径之外的库,需要将库的位置添加到库的搜索路径之中。设置库文件的搜索路径有下列两种方式,可任选其一使用: 在环境变量 LD...2010-05-05 10:01:29 · 72 阅读 · 0 评论 -
c 连接 mysql 数据库
1. MYSQL *mysql_init(MYSQL *mysql) 初始化一个类型为MYSQL的数据结构,为执行mysql_real_connect()做准备。参数mysql为指向该结构的指针,如果mysql为NULL,则新建并初始化一个MYSQL的数据结构。新建的结构将在mysql_close()中释放。 若成功,返回初始化的MYSQL数据结构的指针...2010-04-07 10:40:32 · 75 阅读 · 0 评论 -
c socket 与 php 通信 udp
后台c 语言为服务器端,前台php与客户端。 1.后台c语言代码: (1)socket_connect.h #ifndef SOCKET_CONNECT_H#define SOCKET_CONNECT_H#include <sys/types.h>#include <sys/socket.h>#include <stri...2010-04-05 15:04:13 · 348 阅读 · 0 评论 -
c socket 编程(TCP服务器端代码)
1.文件名为 connect.h #ifndef CONNECT_H#define CONNECT_H/********************功能:连接初始化**输入:port 端口,listen_fd1 监听文件**输出:返回监听文件******************/int connect_init(int port,int *listen_f...2010-04-05 11:33:32 · 247 阅读 · 0 评论 -
c线程基础
需要引入头文件 #include<pthread.h>1.创建线程 int pthread_create(pthread_t *pid,const phread_attr_t *attr,void *(*handler)(void *),void *hand_attr); (1)pid 表示创建线程的id指针 (2)attr表...2010-04-05 10:57:31 · 129 阅读 · 0 评论 -
libnids 主要数据结构
1. tuple4 libnids最基本结构 struct tuple4{ u_short source; //源端口 u_short dest; //目的端口 u_int saddr; //源ip u_int daddr; //目的ip} ...原创 2010-01-03 20:17:42 · 227 阅读 · 0 评论 -
kmp 算法 --转
#include<stdio.h>#include<malloc.h>#include<string.h>#include<assert.h>#include<stdlib.h>#define MAX 256 void getNext(const char * t,int * Next)//get the Next array { i...原创 2010-12-04 16:11:25 · 70 阅读 · 0 评论