- /** Create an outbound connection to a listening socket
- */
- bool MakeOutboundConnection(char* host, int port);
-
- /** Return the servername on this established connection
- */
- std::string GetServerName();
-
- /** Set the server name of this connection
- */
- void SetServerName(std::string serv);
-
- /** Get the file descriptor associated with this connection
- */
- int GetDescriptor();
-
- /** Set the file descriptor for this connection
- */
- void SetDescriptor(int fd);
-
- /** Get the state flags for this connection
- */
- int GetState();
-
- /** Set the state flags for this connection
- */
- void SetState(int state);
-
- /** Get the ip address (not servername) associated with this connection
- */
- char* GetServerIP();
-
- /** Get the server description of this connection
- */
- std::string GetDescription();
-
- /** Set the server description of this connection
- */
- void SetDescription(std::string desc);
-
- /** Get the port number being used for this connection
- * If the connection is outbound this will be the remote port
- * otherwise it will be the local port, so it can always be
- * gautanteed as open at the address given in GetServerIP().
- */
- int GetServerPort();
-
- /** Set the port used by this connection
- */
- void SetServerPort(int p);
-
- /** Set both the host and the port in one operation for this connection
- */
- bool SetHostAndPort(char* host, int port);
-
- /** Close the connection by calling close() on its file descriptor
- * This function call updates no other data.
- */
- void CloseConnection();
-};
-
-
-class packet
-{
- /** Class packet is deprecated.
- * This declaration is preserved here to maintain documentation only.
- */
-};
-
-/** Please note: classes serverrec and userrec both inherit from class connection.
- */
-class connection : public classbase
-{
- public:
- /** File descriptor of the connection
- */
- int fd;
-
- /** Hostname of connection. Not used if this is a serverrec
- */
- char host[256];
-
- /** IP of connection. Reserved for future use.
- */
- long ip;
-
- /** Inbuf of connection. Only used for userrec
- */
- char inbuf[MAXBUF];
-