📄 sockstr.h
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -