connector.h
来自「linux下的终端管理工具源码」· C头文件 代码 · 共 111 行
H
111 行
/***************************************************************************//* *//* Copyright (c) 2005, 2006 2X Software Ltd, http://www.2X.com., NoMachine *//* *//* NXCOMP, NX protocol compression and NX extensions to this software *//* are copyright of Nomachine. Redistribution and use of the present *//* software is allowed according to terms specified in the file LICENSE *//* which comes in the source distribution. *//* *//* NX and NoMachine are trademarks of Medialogic S.p.A. *//* *//* 2X is a trademark of 2X Software Ltd. *//* *//* All rights reserved. *//* *//***************************************************************************/#ifndef Connector_H#define Connector_H#include "Timestamp.h"#include "Runnable.h"enum T_connector_type{ connector_none = -1, connector_tcp, connector_unix};class Connector : protected Runnable{ protected: Connector(T_connector_type type); ~Connector(); public: T_connector_type getType() { return type_; } int setHost(const char *host); int setPort(int port); int setDirectory(const char *directory); int setFile(const char *file); int setTimeout(const T_timestamp timeout); const char *getNode() { return node_; } int getFd() { return fd_; } int start(); int end(); protected: int startTcp(); int startUnix(); int makeNode(); private: int fd_; int port_; char *host_; char *directory_; char *file_; char *node_; T_timestamp timeout_; T_connector_type type_;};class UnixConnector : public Connector{ public: UnixConnector() : Connector(connector_unix) { }};class TcpConnector : public Connector{ public: TcpConnector() : Connector(connector_tcp) { }};#endif /* Connector_H */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?