sockstr.h~
来自「ALGAE是一个快速创建算法演示的框架。目前支持的算法实现语言包括java和c」· H~ 代码 · 共 54 行
H~
54 行
#ifndef SOCKET_STREAM_H#define SOCKET_STREAM_H#include <algae/config.h>#include <iostream>//// The SocketBuffer is used to interface C++ stream I/O// to a socket.//class SocketBuffer: public STD streambuf{public: SocketBuffer (int socketDescriptor, int bufferSize, bool forInput); ~SocketBuffer (); virtual int sync (); virtual int overflow (int ch); virtual int underflow();private: char* buffer; int bufSize; int socketd;};//// Stream output to a socket//class oSocketStream: public STD ostream{public: oSocketStream (int socketDescriptor); ~oSocketStream ();private:// oSocketStream () {}};//// Stream input from a socket.//class iSocketStream: public STD istream{public: iSocketStream (int socketDescriptor); ~iSocketStream ();private:// iSocketStream () {}};#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?