@@ -15,12 +15,16 @@
#include "../../stdafx.h"
#include "../../debug.h"
#include "tcp.h"
/**
* Construct a socket handler for a TCP connection.
* @param s The just opened TCP connection.
*/
NetworkTCPSocketHandler::NetworkTCPSocketHandler(SOCKET s) :
NetworkSocketHandler(),
packet_queue(NULL), packet_recv(NULL),
sock(s), writable(false)
{
}
@@ -135,14 +139,13 @@ SendPacketsState NetworkTCPSocketHandler
return SPS_ALL_SENT;
* Receives a packet for the given client
* @param status the variable to store the status into
* @return the received packet (or NULL when it didn't receive one)
* @return The received packet (or NULL when it didn't receive one)
Packet *NetworkTCPSocketHandler::ReceivePacket()
ssize_t res;
if (!this->IsConnected()) return NULL;
@@ -216,13 +219,13 @@ Packet *NetworkTCPSocketHandler::Receive
return p;
* Check whether this socket can send or receive something.
* @return \c true when there is something to receive.
* @note Sets #writeable if more data can be sent.
* @note Sets #writable if more data can be sent.
bool NetworkTCPSocketHandler::CanSendReceive()
fd_set read_fd, write_fd;
struct timeval tv;