Page MenuHomePhorge

NetworkSystem.cpp
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

NetworkSystem.cpp

#include <echo/Network/NetworkSystem.h>
#include <echo/Network/NetworkManager.h>
#include <echo/Network/Connection.h>
namespace Echo
{
void NetworkSystem::UpdateIncoming(shared_ptr<Connection> connection, IncomingConnectionListener* listener)
{
mNetworkManager.ConnectionIncoming(connection,listener);
}
void NetworkSystem::UpdateConnect( shared_ptr<Connection> connection )
{
if(connection->IsConnected())
{
mNetworkManager.ConnectionEstablished(connection);
}else
{
mNetworkManager.ConnectionDropped(connection);
}
}
void NetworkSystem::UpdateReceive( shared_ptr<Connection> connection )
{
bool hadNoPackets = (connection->GetNumReceviedPackets() == 0);
int numberOfPacketsReady = connection->Receive();
//If there were no packets before we called recv but now there
//are then we need to notify the network manager to queue the
//connection for owner packet notification. Otherwise we'll
//assume that the network manager already has the packet
//queued.
if(hadNoPackets && numberOfPacketsReady>0)
{
mNetworkManager.ConnectionPacketReceived(connection);
}
}
void NetworkSystem::UpdateWrite( shared_ptr<Connection> connection )
{
connection->SetCanSend(true);
connection->Write();
}
}

File Metadata

Mime Type
text/x-c++
Expires
Thu, Dec 5, 5:49 PM (11 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
61537
Default Alt Text
NetworkSystem.cpp (1 KB)

Event Timeline