40 mTimeoutTimer( TIMEOUT_MS )
46 mTimeoutTimer( TIMEOUT_MS )
58 if (PACKET_SIZE_LIMIT < pBuffer->size()) {
59 sLog.Error(
"Network",
"Packet length %u exceeds hardcoded packet length limit %lu.", pBuffer->
size(),
PACKET_SIZE_LIMIT );
74 *bufLen = ( pBuffer->
size() -
sizeof(
uint32 ) );
77 sLog.Error(
"Network",
"Failed to marshal new packet." );
91 if (packet !=
nullptr) {
92 if ( PACKET_SIZE_LIMIT < packet->size() ) {
93 sLog.Error(
"Network",
"Packet length %lu exceeds hardcoded packet length limit %u.", packet->
size(),
PACKET_SIZE_LIMIT );
107 if (errbuf !=
nullptr)
127 if (errbuf !=
nullptr)
162 time_t rawtime = time(0);
163 tm *now = localtime(&rawtime);
164 strftime(timestamp,16,
"%y%m%d_%H%M%S",now);
166 std::string path = EVEMU_ROOT
"/packet_log/";
173 logpacket = fopen(path.c_str(),
"w");
176 for (; cur != buf->
end<
uint8>(); ++cur) {
178 fputc(test, logpacket);
Simple wrapper for sockets.
void ResizeAt(const_iterator< T > index, size_type requiredCount, const uint8 &fill=0)
Resizes buffer.
bool MarshalDeflate(const PyRep *rep, Buffer &into, const uint32 deflationLimit)
static const uint32 PACKET_SIZE_LIMIT
Hardcoded limit of packet size (NetClient.dll).
PyRep * InflateUnmarshal(const Buffer &data)
Turns possibly inflated marshal stream into Python object.
packet_direction
Dumps buffer to file.
void ClearBuffers()
Clears send and receive buffers.
A lock for a Lockable object.
bool RecvData(char *errbuf=0)
Receives data and puts them into receive queue.
virtual bool RecvData(char *errbuf=0)
Receives data and puts them into receive queue.
virtual void ClearBuffers()
Clears send and receive buffers.
void QueueRep(const PyRep *rep, bool compress=true)
Queues given PyRep into send queue.
static const uint32 TIMEOUT_MS
Time (in milliseconds) after which the connection is dropped if no data were received.
PyRep * PopRep()
Pops PyRep from receive queue.
bool Send(Buffer **data)
Enqueues data to be sent.
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
static const uint32 TCPCONN_ERRBUF_SIZE
#define sLog
Evaluates to a NewLog instance.
bool ProcessReceivedData(char *errbuf=0)
Processes received data.
Generic class for buffers.
void DumpBuffer(Buffer *buf, packet_direction packet_direction)
StreamPacketizer mInQueue
Received data queue.
bool Check(bool reset=true)
Generic class for TCP connections.
EVETCPConnection()
Creates empty EVE connection.
void InputData(const Buffer &data)
Timer mTimeoutTimer
Timer used to implement timeout.
Mutex mMInQueue
Mutex to protect received data queue.
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)