本文整理汇总了C#中Network.GetAddress方法的典型用法代码示例。如果您正苦于以下问题:C# Network.GetAddress方法的具体用法?C# Network.GetAddress怎么用?C# Network.GetAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network
的用法示例。
在下文中一共展示了Network.GetAddress方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NotifyJoinService
public void NotifyJoinService(Service service, Network network)
{
dynamic packet = new JObject();
packet.type = "notify_join_service";
packet.service = service.GetServiceName();
packet.id = service._id;
packet.address = network.GetAddress(service);
packet.port = service._port;
this.SendPacket(packet);
}
示例2: GetServicesNetworkInfo
public dynamic GetServicesNetworkInfo(Network network)
{
dynamic packet = new JObject();
packet.type = "network_info";
packet.service = GetServicesName();
packet.network = new JArray();
//_servicesLock.EnterReadLock();
for (int i = 0; i <= _maxIndex; i++)
{
if(_services[i] == null)
continue;
byte[] host = network.GetAddress(_services[i]);
if(host != null)
packet.network.Add(host);
}
//_servicesLock.ExitReadLock();
return packet;
}
示例3: NotifyJoinService
public int NotifyJoinService(Service service, Network network)
{
int count = 0;
//이제 연결된 서비스들에게 상태를 보고함.
for (int i = 0; i <= _maxIndex; i++)
{
if(network.GetAddress(_services[i]) == null)
continue;
_services[i].NotifyJoinService(service, network);
count++;
}
return count;
}