diff options
author | rubidium <rubidium@openttd.org> | 2007-02-01 23:50:15 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-02-01 23:50:15 +0000 |
commit | 922a62340279e792203ea196df8f57b85318eb1e (patch) | |
tree | 306b2cff1ed499943aa588aab87f72640a052b57 /src/network/core/tcp.h | |
parent | 6ff65bdf3bfa76f4839c763a1091d6e59653daea (diff) | |
download | openttd-922a62340279e792203ea196df8f57b85318eb1e.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.h | 17 |
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 */ |