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