本文整理汇总了C#中Server.Network.NetState.Start方法的典型用法代码示例。如果您正苦于以下问题:C# NetState.Start方法的具体用法?C# NetState.Start怎么用?C# NetState.Start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Network.NetState
的用法示例。
在下文中一共展示了NetState.Start方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckListener
private void CheckListener()
{
for (int j = 0; j < m_Listeners.Length; ++j)
{
var accepted = m_Listeners[j].Slice();
for (int i = 0; i < accepted.Length; ++i)
{
NetState ns = new NetState(accepted[i], this);
ns.Start();
if (ns.Running)
{
Utility.PushColor(ConsoleColor.Green);
Console.WriteLine("Client: {0}: Connected. [{1} Online]", ns, NetState.Instances.Count);
Utility.PopColor();
}
}
}
}
示例2: CheckListener
private void CheckListener()
{
for ( int j = 0; j < m_Listeners.Length; ++j )
{
Socket[] accepted = m_Listeners[j].Slice();
for ( int i = 0; i < accepted.Length; ++i )
{
NetState ns = new NetState( accepted[i], this );
ns.Start();
if ( ns.Running )
Console.WriteLine( "Client: {0}: Connected. [{1} Online]", ns, NetState.Instances.Count );
}
}
}
示例3: GameServerClient
public static NetState GameServerClient(Config.GameServer config)
{
if (config == null)
return null;
String address = config.Address.ToString();
NetState ns = (NetState)m_GameServers[address];
if (ns != null)
return ns;
try {
ns = new NetState(config.Address, Core.MessagePump);
ns.Start();
ns.Send(new SendSeed());
m_GameServers[address] = ns;
return ns;
} catch (Exception e) {
log.Error(String.Format("Exception while trying to connect to game server {0} ({1}): {2}",
config.Name, address),
e);
return null;
}
}
示例4: CheckListener
private void CheckListener()
{
foreach ( var socket in m_Listeners.SelectMany( listener => listener.Slice() ) )
{
NetState ns = new NetState( socket, this );
ns.Start();
if ( ns.Running )
InvokeConnected( ns );
}
}