private void Update()
{
if (this.m_HostId == -1 || this.m_IsServer)
{
return;
}
NetworkEventType fromHost;
do
{
int connectionId;
int channelId;
int receivedSize;
byte error;
fromHost = NetworkTransport.ReceiveFromHost(this.m_HostId, out connectionId, out channelId, this.m_MsgInBuffer, 1024, out receivedSize, out error);
if (fromHost == NetworkEventType.BroadcastEvent)
{
NetworkTransport.GetBroadcastConnectionMessage(this.m_HostId, this.m_MsgInBuffer, 1024, out receivedSize, out error);
string address;
int port;
NetworkTransport.GetBroadcastConnectionInfo(this.m_HostId, out address, out port, out error);
NetworkBroadcastResult networkBroadcastResult = new NetworkBroadcastResult();
networkBroadcastResult.serverAddress = address;
networkBroadcastResult.broadcastData = new byte[receivedSize];
Buffer.BlockCopy((Array)this.m_MsgInBuffer, 0, (Array)networkBroadcastResult.broadcastData, 0, receivedSize);
this.m_BroadcastsReceived[address] = networkBroadcastResult;
this.OnReceivedBroadcast(address, NetworkDiscovery.BytesToString(this.m_MsgInBuffer));
}
}while (fromHost != NetworkEventType.Nothing);
}