自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(59)
  • 资源 (7)
  • 收藏
  • 关注

原创 最简单的基于FFmpeg的AVfilter的例子-修正版

代码是参考雷神的博客的代码,不过由于ffmpeg版本不同,记录使用中遇到的问题。 1.调用avfilter_get_by_name("ffbuffersink")时在新版本的ffmpeg要修改为avfilter_get_by_name("buffersink");否则返回指针为空,调用avfilter_graph_create_filter返回-12,在以前的版本则没有这个问题。2....

2017-10-31 10:08:34 7105 2

原创 Visual Studio 2017开发linux程序之libevent使用实例

下载源码编译安装后,samle里面有个hello-world.c就是最简单的一个tcp server端程序了/* This example program provides a trivial server program that listens for TCP connections on port 9995. When they arrive, it writes a shor

2017-10-30 11:07:41 1730

原创 统一建模语言UML要点全面简析

统一建模语言UML要点全面简析前言uml就是一些图,一些由框框和线条构成的图,框框称为事物,线条表示4种关系,这些框框和线条的说明注释。 一.uml概述统一建模语言(UML)是面向对象软件的标准化建模语言。UML由3个要素构成:UML的基本构造块,支配这些构造块如何放置在一起的规则,运用于整个语言的一些公共机制。UML的词汇表包括3种构造块:事物、关系、图事

2017-10-29 21:50:56 2399 1

原创 Visual Studio 2017开发linux程序使用实例及原理简析

1.下载安装vs开发linux程序的工具包2.创建一个工程,选择跨平台里面的linux平台3.写一段测试代码,这里就可以包含linux的系统头文件编译,不过vs下还是现实红的#include #include #include #include #include #include #include #include #include #include #i

2017-10-27 12:48:51 2021

原创 boost智能指针之shared_ptr,scoped_ptr,intrusive_ptr,weak_ptr源码简析

boost库实现了各种智能指针,基本上都纳入了c++11标准中,boost库的smart_ptr目录下就是各种指针的实现了:1.shared_ptrtemplate class shared_ptr{private: // Borland 5.5.1 specific workaround typedef shared_ptr this_t

2017-10-22 00:53:31 725

原创 Linux快速读取文件之文件映射c++实例

typedef struct file_info_value { std::string file_name_; long size_; int fd_; char *buff_; boost::recursive_mutex cond_mtx_; boost::condition_variable_any cond_var_; boost::atomic is_m

2017-10-20 16:46:36 660

原创 boost之asio实现定时器使用实例

#ifndef TCP_SERVER_H#define TCP_SERVER_H#include "boost_comm.h"#include "tcp_client.h"#include "session_manager.h"#include "command_machine.h"#include "task_engine.h"#include "search_engine.h

2017-10-19 16:18:27 657

原创 boost之对象池使用实例

这个主要用在http使用tcp支持短连接的情况,能快速获取连接对象而不用反复申请释放资源#ifndef OBJECT_POOL_H#define OBJECT_POOL_H#include "boost_comm.h"#include "message_header.h"#include "tcp_client.h"namespace seemmo{ //template

2017-10-19 16:06:47 886

原创 boost之内存池使用实例

需要说明的就是初始化的时候指定的是内存池分配内存块的大小,而且内存池是非线程安全的,多线程要加锁#ifndef BUFFER_POOL_H#define BUFFER_POOL_H#include "boost_comm.h"using namespace boost;namespace seemmo{ class buffer_pool { public: buffe

2017-10-19 16:02:48 1101

原创 Nosql数据库之mongodb c++使用实例

mongodb是一个非关系型高速数据库,由多个文档(相当于关系数据库中的行记录)组成集合,多个集合(相当于关系数据库中的数据表)组成数据库。使用命令安装或者源码安装mongodb,安装完成后mongod就是mongodb数据库服务的主程序了,指定参数或者配置文件启动命令如下mongod -f /etc/mongodb.conf或者mongod --dbpath=/home/lsx/m

2017-10-19 15:21:10 1433

原创 高速缓存系统之memcache c++使用实例

下载源码编译,memcached就是生成的主程序,启动可指定端口,memcached作为server端,依然是我们熟悉的cs模式,使用两个client一个setkey,一个getkey一百万个做测试。./memcached -d -m 300 -p 11211 -u root -c 4096#include "../libmemcached-1.0.7/libmemcached/memcach

2017-10-18 17:23:59 1518

原创 boost之无锁队列使用实例

#ifndef SEARCH_ENGINE_H#define SEARCH_ENGINE_H#include "boost_comm.h"#include "message_header.h"namespace tspace{ class search_engine { public: search_engine(); ~search_engine(); public

2017-10-18 17:06:50 1972

原创 boost之线程池使用实例

#pragma once#ifndef THREAD_POOL_H#define THREAD_POOL_H#include "boost_comm.h"using namespace std;//using namespace boost::executors;namespace seemmo{#ifdef ENABLE_BOOST_THREAD class thre

2017-10-18 16:43:40 2367

原创 google开源库glog源码实现分析

#include # define GOOGLE_GLOG_DLL_DECL __declspec(dllexport)# define GOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS __declspec(dllimport)namespace base_logging { // LogMessage::LogStream is a std::ostream

2017-10-18 16:34:13 1218

原创 c++内存管理优化之ptmalloc,tcmalloc,jemalloc使用实例

ptmalloc 是glibc的内存分配管理tcmalloc 是google的内存分配管理模块jemalloc 是BSD的提供的内存分配管理写一段代码测试一下#include #include #include extern "C"{#include "jemalloc.h"}#include #include using namespace std;int

2017-10-18 15:59:19 2631

原创 高速缓存系统之redis c++使用实例

redis是一个key-value型的非关系型数据库,我们更多的是用于做高速缓存系统,解决前端请求与后台处理不匹配的业务场景。下载源码安装后,redis-server就是redis服务的主程序了,进入redis-4.0.1目录执行启动命令./src/redis-server redis.confredis.conf是配置文件,里面有bind的ip和port,tcp-backlog就是tcp

2017-10-18 11:03:03 2382

原创 Linux下进程间通信方式之管道、信号、共享内存、消息队列、信号量、套接字

/*1,进程间通信 (IPC ) Inter-Process Communication  比较好理解概念的就是进程间通信就是在不同进程之间传播或交换信息。 2,linux下IPC机制的分类:管道、信号、共享内存、消息队列、信号量、套接字 3,这篇主要说说管道:本质是文件,其他理论什么的网上已经有一大堆了,我就只写一点用法吧。 3.1 特点 1)管道是最古老的IPC,但目前

2017-10-17 21:18:29 1252 1

原创 win32下进程间通信方式之管道、邮件槽、剪切板、共享内存、消息、套接字、RPC、DDE等

#include "stdafx.h"/*32位Windows采用虚拟内存技术使每个进程虚拟4G内存,在逻辑上实现了对进程之间数据代码的分离与保护。那么相应的进程之间的通信也就有必要整理掌握一下。Windows进程间通讯的方法有很多:管道、邮件槽、剪切板、共享内存、消息、套接字、RPC、DDE等。但是他们大部分拥有一个共同的本质:利用Windows操作系统高2GB内核共享空间进行数据传递的

2017-10-17 21:17:19 1000

原创 网络开源框架之libuv使用实例

/* Copyright StrongLoop, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Softw

2017-10-17 21:03:18 2853 1

原创 网络开源框架之libevent使用实例

#pragma once#include "CLibEventData.h"#include "LibEventFunction.h"#include "LibUserFunction.h"class CLibEvent{public: CLibEvent(void); ~CLibEvent(void);private: //当前服务器对象 Server m_Server;

2017-10-17 20:51:45 793

原创 网络开源框架之libev使用实例

// libev.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include #include #include #include #include #include #include #include #include #include #include #inc

2017-10-16 01:08:59 1025

原创 网络编程五种IO模型之WSAEventSelect模型

/* client.cpp */#include #include #include #include #include "Globle.h"#pragma comment(lib, "ws2_32.lib")#define MAX_THREAD 5HANDLE ThreadPool[MAX_THREAD] = {NULL};volatile BOOL bE

2017-10-16 00:19:11 400

原创 网络编程五种IO模型之WSAAsyncSelect模型

/* client.cpp */#include #include #include #include #include "Globle.h"#pragma comment(lib, "ws2_32.lib")#define MAX_THREAD 5HANDLE ThreadPool[MAX_THREAD] = {NULL};volatile BOOL bE

2017-10-16 00:18:06 336

原创 网络编程五种IO模型之poll模型

// poll_impl.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include /* basic system data types */#include /* basic socket definitions */#include /* sockaddr_in{} and

2017-10-16 00:13:24 301

原创 网络编程五种IO模型之select模型

/* client.cpp */#include #include #include #include #include "Globle.h"#pragma comment(lib, "ws2_32.lib")#define MAX_THREAD 5HANDLE ThreadPool[MAX_THREAD] = {NULL};volatile BOOL bE

2017-10-16 00:11:19 328

原创 网络编程五种IO模型之epoll模型

#include #include #include //#include #include "Globle.h"#pragma comment(lib, "ws2_32.lib")//#define MAX_CLIENT 5#define NEXT_IO_READ 0 // 下一步是RECV 操作#define NEXT_IO_SEND 1 // 下一步是S

2017-10-16 00:09:57 355

原创 网络编程五种IO模型之重叠IO模型-事件驱动

#ifndef Globle_H#define Globle_H#include #include #include #include using namespace std;#define BUFFER_SIZE 64#define PORT 4567char Data[37] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";

2017-10-16 00:07:53 537

原创 网络编程五种IO模型之重叠IO模型-完成例程

/* client.cpp */#include #include #include #include #include "Globle.h"#pragma comment(lib, "ws2_32.lib")#define MAX_THREAD 5HANDLE ThreadPool[MAX_THREAD] = {NULL};volatile BOOL bE

2017-10-16 00:06:19 645

原创 网络编程五种IO模型之IOCP模型

/* client.cpp */#include #include #include #include #include "Globle.h"#pragma comment(lib, "ws2_32.lib")#define MAX_THREAD 5HANDLE ThreadPool[MAX_THREAD] = {NULL};volatile BOOL bE

2017-10-16 00:03:14 918

原创 Linux下多线程同步方式之互斥量,信号量,条件变量

// linux_thread_syn.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"//互斥量#include #include #include #include #include "iostream" using namespace std; pthread_mutex_t mutex = PTHREAD_MUT

2017-10-16 00:01:50 327

原创 win32下多线程同步方式之临界区,互斥量,事件对象,信号量

// win32_thread_syn.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "iostream"#include "list"#include "windows.h"#include "process.h"using namespace std;/*线程同步1.临界区2.信号量3.事件对象4.互斥量*/

2017-10-15 23:59:58 1054

原创 boost之asio异步io使用实例

// boost_asio_client.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include #include #include #include #include #include #include #include #include #include #p

2017-10-08 15:18:25 1384

原创 boost之asio同步io使用实例

// boost_sync_client.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include #include #include #include #include #include #include #include #include #include #

2017-10-08 15:17:05 482

原创 ACE之Proactor模式使用实例

// ACE_Proactor_Client.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "ace/Message_Queue.h"#include "ace/Asynch_IO.h"#include "ace/OS.h"#include "ace/Proactor.h"#include "ace/Asynch_Connec

2017-10-08 14:50:55 1238

原创 ACE之Reactor模式使用实例

// ACE_Reactor_Client.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "ace/Reactor.h" #include "ace/SOCK_Connector.h" #include "ace/OS.h"#include "ace/Log_Msg.h"#include #include u

2017-10-08 14:48:00 889

原创 C++使用ICE实现两台主机通信实例

ice使用过程跟google protocol buffer、gsoap类似,都是先写一个类似配置文件的东西,然后使用提供的工具生成相应语言的代码。ice先写一个后缀名为.ice的文件,然后使用slice2cpp.exe生产对应c++代码,如下module MCal{ interface Cal { int add(int num1,int num2);

2017-10-08 11:35:16 2477

原创 设计模式-行为-访问者

#pragma once#ifndef VISITOR_H #define VISITOR_H class Visitor; class Element { public: virtual ~Element(){} virtual void Accept(Visitor &rVisitor) = 0; protected: Element(){} }; cl

2017-10-07 20:36:14 292

原创 设计模式-行为-模板方法

#pragma once// 抽象基类,定义 法的轮廓 class AbstractClass { public: AbstractClass(){} virtual ~AbstractClass(){} // 这个函数中定义了 法的轮廓 void TemplateMethod(); protected: // 纯虚函数,由派生类实现之 virtual vo

2017-10-07 20:33:29 220

原创 设计模式-行为-策略

#pragma once#ifndef STRATEGY_H #define STRATEGY_H class Strategy; class Context { public: Context(Strategy *pStrategy); ~Context(); void ContextInterface(); private: Strategy* m_pS

2017-10-07 20:32:21 220

原创 设计模式-行为-状态

#pragma once#ifndef STATE_H #define STATE_H class State; class Context { public: Context(State* pState); ~Context(); void Request(); void ChangeState(State *pState); private: Sta

2017-10-07 20:30:45 306

数学专业英语词汇20rmb.pdf

整理的常用的数学词汇,都是干货,是我花了20元在别的网站买来的啊,现在分享给大家。

2019-10-15

Microsoft Windows网络编程(第二版,有书签)

Microsoft Windows网络编程(第二版,有书签)

2015-04-22

linu C程序设计大全 吴岳 完整版 part1

linu C程序设计大全 吴岳 完整版

2015-03-27

linu C程序设计大全 吴岳 完整版 part3

linu C程序设计大全 吴岳 完整版

2015-03-27

linu C程序设计大全 吴岳 完整版 part2

linu C程序设计大全 吴岳 完整版

2015-03-27

android sdk 模拟器 懒人版-part3

这个是别人整理的不用安装更新的资源,我亲测可用的,所以分享到这里。 简介:SDK:(software development kit)软件开发工具包。被软件开发工程师用于为特定的软件包、软件框架、硬件平台、操作系统等建立应用软件的开发工具的集合。 因此,Android SDk 指的既是Android专属的软件开发工具包。 实际上我不得不说Android很土,SDK 给的根本没法用,因为要还需要下载N多东西, Google那个网站又被墙,速度又慢。 如果你是个懒虫就跟我一样用这个吧,直接解压缩就可以用。 只包括1.6-〉3.2 N多版本,方便开发调试,只包括模拟器部分,可以保证开发文档什么都有了,至少我是够用了 基本上不喜欢开发的人,也可以用模拟器体验下了 前提你的机器上要装 JDK 更新:如需开发SDK 4.0 以及虚拟机,还需要下载我这里的ARM EABI v7a System Image这个资源。

2014-12-31

vc编程pppoe-discovery

工程使用vs2010编写,要求安装winpcap驱动,若出现找不到头文件,请包含winpcap库目录以及头文件目录,实现windows下捕获网络数据帧,数据链路层数据,实现pppoe协议discovery阶段,发现服务器,目前来说网上还没有像这样的代码,同时也是实现网络底层抓包学习的好资料。

2012-09-17

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除