|
|
@ -148,9 +148,13 @@ void CYSFNetwork::writeUnlink(unsigned int count)
|
|
|
|
void CYSFNetwork::clock(unsigned int ms)
|
|
|
|
void CYSFNetwork::clock(unsigned int ms)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
unsigned char buffer[BUFFER_LENGTH];
|
|
|
|
unsigned char buffer[BUFFER_LENGTH];
|
|
|
|
|
|
|
|
|
|
|
|
in_addr address;
|
|
|
|
in_addr address;
|
|
|
|
unsigned int port;
|
|
|
|
unsigned int port;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_pollTimer.clock(ms);
|
|
|
|
|
|
|
|
if (m_pollTimer.isRunning() && m_pollTimer.hasExpired())
|
|
|
|
|
|
|
|
writePoll();
|
|
|
|
|
|
|
|
|
|
|
|
int length = m_socket.read(buffer, BUFFER_LENGTH, address, port);
|
|
|
|
int length = m_socket.read(buffer, BUFFER_LENGTH, address, port);
|
|
|
|
if (length <= 0)
|
|
|
|
if (length <= 0)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -158,10 +162,6 @@ void CYSFNetwork::clock(unsigned int ms)
|
|
|
|
if (m_port == 0U)
|
|
|
|
if (m_port == 0U)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
m_pollTimer.clock(ms);
|
|
|
|
|
|
|
|
if (m_pollTimer.isRunning() && m_pollTimer.hasExpired())
|
|
|
|
|
|
|
|
writePoll();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (address.s_addr != m_address.s_addr || port != m_port)
|
|
|
|
if (address.s_addr != m_address.s_addr || port != m_port)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|