Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F96987
NetworkSystem.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
NetworkSystem.cpp
View Options
#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
Details
Attached
Mime Type
text/x-c++
Expires
Thu, Dec 5, 5:49 PM (22 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
61537
Default Alt Text
NetworkSystem.cpp (1 KB)
Attached To
Mode
rEE Echo 3
Attached
Detach File
Event Timeline
Log In to Comment