- /**
- * Whenever close() is called, OnClose() will be
- * called first. Please note that this means
- * OnClose will be called alongside OnError(),
- * OnTimeout(), and Close().
- */
- virtual void OnClose();
-
- /**
- * Reads all pending bytes from the socket
- * into a char* array which can be up to
- * 16 kilobytes in length.
- */
- virtual const char* Read();
-
- /**
- * Returns the IP address associated with
- * this connection, or an empty string if
- * no IP address exists.
- */
- std::string GetIP();
-
- /**
- * Writes a std::string to the socket. No carriage
- * returns or linefeeds are appended to the string.
- * @param data The data to send
- */
- virtual void Write(const std::string &data);
-
- /**
- * Changes the socket's state. The core uses this
- * to change socket states, and you should not call
- * it directly.
- */
- void SetState(BufferedSocketState s);
-
- /**
- * Returns the current socket state.
- */
- BufferedSocketState GetState();
-
- /** Mark a socket as being connected and call appropriate events.
- */
- bool InternalMarkConnected();
-
- /**
- * This method causes the socket to close, and may
- * also be triggered by other methods such as OnTimeout
- * and OnError.
- */
- virtual void Close();
-
- /**
- * The destructor may implicitly call OnClose(), and
- * will close() and shutdown() the file descriptor
- * used for this socket.
- */