摘要: 本文内容为网络转载。 1. 概念理解 在进行网络编程时,我们常常见到同步(Sync)/异步(Async),阻塞(Block)/非阻塞(Unblock)四种调用方式:同步: 所谓同步,就是在发出一个功能调用时,在没有得到结果之前,该调用就不返回。也就是必须一件一件事做,等前一件做完了才能做下一件事。 阅读全文
posted @ 2016-04-20 14:26 风也沉默 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 多线程退出有三种方式:(1)执行完成后隐式退出;(2)由线程本身显示调用pthread_exit 函数退出; pthread_exit (void * retval) ; (3)被其他线程用pthread_cancel函数终止: pthread_cancel (pthread_t thread) ; 阅读全文
posted @ 2016-04-20 14:25 风也沉默 阅读(1932) 评论(0) 推荐(0) 编辑
摘要: 需要在结构体中重载'<'运算符,下面是我写的一个例子: 阅读全文
posted @ 2016-04-20 14:24 风也沉默 阅读(473) 评论(0) 推荐(0) 编辑
摘要: 个人编写的小例子,没有注释,刚毕业时作为技术调研随手编写,仅供参考: 阅读全文
posted @ 2016-04-20 14:22 风也沉默 阅读(444) 评论(0) 推荐(0) 编辑
摘要: 以下内容来源网上 经过整合而成(转载) 一、一般介绍 STL(Standard Template Library),即标准模板库,是一个具有工业强度的,高效的C++程序库。它被容纳于C++标准程序库(C++ Standard Library)中,是ANSI/ISO C++标准中最新的也是极具革命性的 阅读全文
posted @ 2016-04-20 14:20 风也沉默 阅读(566) 评论(0) 推荐(0) 编辑
摘要: asctime() basename() catgets() crypt() ctermid()//if passed a non-NULL argument ctime() dbm_clearerr() dbm_close() dbm_delete() dbm_error() dbm_fetch( 阅读全文
posted @ 2016-04-20 14:19 风也沉默 阅读(858) 评论(0) 推荐(0) 编辑
摘要: 使用场景:日志、打印等 #define mog_error(format,...) fprintf(stderr, "[%s, %d]:"format"\n", __FILE__, __LINE__, ##__VA_ARGS__) 阅读全文
posted @ 2016-04-20 14:17 风也沉默 阅读(279) 评论(0) 推荐(0) 编辑