summaryrefslogtreecommitdiff
path: root/src/network/core/tcp.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-02-01 23:50:15 +0000
committerrubidium <rubidium@openttd.org>2007-02-01 23:50:15 +0000
commit59f4f056df58de1bd38282363e33bbc0e202835b (patch)
tree306b2cff1ed499943aa588aab87f72640a052b57 /src/network/core/tcp.h
parent4ebb009ab4bf21cce506fc64ecf57468f04a9204 (diff)
downloadopenttd-59f4f056df58de1bd38282363e33bbc0e202835b.tar.xz
(svn r8525) -Codechange: make NetworkSend_Packet(s) and NetworkRecv_Packet functions of NetworkTCPSocketHandler.
Diffstat (limited to 'src/network/core/tcp.h')
-rw-r--r--src/network/core/tcp.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/network/core/tcp.h b/src/network/core/tcp.h
index 232d6f91a..b7150a447 100644
--- a/src/network/core/tcp.h
+++ b/src/network/core/tcp.h
@@ -84,6 +84,9 @@ typedef enum {
/** Base socket handler for all TCP sockets */
class NetworkTCPSocketHandler : public NetworkSocketHandler {
/* TODO: rewrite into a proper class */
+private:
+ Packet *packet_queue; ///< Packets that are awaiting delivery
+ Packet *packet_recv; ///< Partially received packet
public:
uint16 index; ///< Client index
uint32 last_frame; ///< Last frame we have executed
@@ -93,20 +96,18 @@ public:
ClientStatus status; ///< Status of this client
bool writable; ///< Can we write to this socket?
- Packet *packet_queue; ///< Packets that are awaiting delivery
- Packet *packet_recv; ///< Partially received packet
-
CommandPacket *command_queue; ///< The command-queue awaiting delivery
NetworkRecvStatus CloseConnection();
void Initialize();
-};
+ void Destroy();
+ void Send_Packet(Packet *packet);
+ bool Send_Packets();
+ bool IsPacketQueueEmpty();
-
-void NetworkSend_Packet(Packet *packet, NetworkTCPSocketHandler *cs);
-Packet *NetworkRecv_Packet(NetworkTCPSocketHandler *cs, NetworkRecvStatus *status);
-bool NetworkSend_Packets(NetworkTCPSocketHandler *cs);
+ Packet *Recv_Packet(NetworkRecvStatus *status);
+};
#endif /* ENABLE_NETWORK */