inetsocket.h

来自「LINUX下发送邮件的库,测试很好用,有各种发送测试的例子」· C头文件 代码 · 共 86 行

H
86
字号
/************************************************************************* *                                                                       * * This program is free software; you can redistribute it and/or modify  * * it under the terms of the GNU General Public License as published by  * * the Free Software Foundation; either version 2 of the License, or     * * (at your option) any later version.                                   * *                                                                       * *************************************************************************/#ifndef _INETSOCKET_H__#define _INETSOCKET_H__#include "global.h"#include "exception.h"#include "logger.h"#include "i18n.h"#include "sslsocket.h"#include <strings.h>#include <unistd.h>#include <arpa/inet.h>#include <netdb.h>#include <sys/socket.h>#include <netinet/in.h>#include <errno.h>#include <string>using namespace std;/** * This class describes a tcp socket. * * @author Timo Benk <t_benk@web.de> */class InetSocket : public SSLSocket{	public:		/**		 * Constructor.		 *		 * @param host The host this socket should connect.		 * @param port The port this socket should connect.		 */		InetSocket			( 				const string &host,				int port			);		/**		 * Constructor.		 *		 * @param host The host this socket should connect.		 * @param port The port this socket should connect.		 * @param fd   The file descriptor this socket uses for IO.		 */		InetSocket			( 				int fd,				const string &host = "",				int port           = 65535			);		/**		 * Destructor.		 */		~InetSocket ();		/**		 * Open the socket.		 *		 * @throws TransferException		 *                    If the connection to the host cannot be		 *                    established.		 */		void connect ();	protected:		/**		 * The port that we want to connect to.		 */		int port;};#endif

⌨️ 快捷键说明

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