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

📄 workthread.h

📁 用socket++,zthread,occi开发的连数据库处理业务的网络中间件服务器程序
💻 H
字号:
#ifndef WORKTHREAD_H_#define WORKTHREAD_H_#include <iostream>#include <string>#include "socket++/sockinet.h"#include "zthread/Thread.h"#include "zthread/Mutex.h"#include "zthread/Guard.h"#include "zthread/Condition.h"#include "zthread/ThreadedExecutor.h"#include "occi.h"#include "TQueue.h"#include "Trim.h"#include "interface.h"typedef ZThread::CountedPtr< TQueue<iosockinet*> > SockQueue;class Worker : public ZThread::Runnable {	SockQueue sockQueue;	int threadno;	oracle::occi::StatelessConnectionPool *scp;public:	char SendBytes[MAX_SENDBYTES];	int SendLength;public:	Worker(SockQueue& sq, int i,oracle::occi::StatelessConnectionPool *scp) :		sockQueue(sq), threadno(i),scp(scp) {		std::cout << "thread["<<i<<"] boot..."<< std::endl;	}	void run() {		try		{			while(!ZThread::Thread::interrupted())			{				iosockinet *sock = sockQueue->get();				std::cout << "thread["<<threadno<<"] handle"<< std::endl;				process_request(sock);			}		}		catch(ZThread::Interrupted_Exception&)		{ std::cout << "Interrupted_Exception"<<std::endl;}		std::cout << "Butterer off"<< std::endl;	}	int process_request(iosockinet *sock);	bool ProcessProcedure(ProcParams *list,std::string &buffer);	int doTask(std::string &buffer);};#endif /*WORKTHREAD_H_*/

⌨️ 快捷键说明

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