Ejemplo n.º 1
0
 internal NetData(ScoreboardNetInfo s)
 {
     Name           = s.Name;
     Ip             = s.Ip;
     NetMask        = s.NetMask;
     DefaultGateway = s.DefaultGateway;
 }
Ejemplo n.º 2
0
        public ScoreboardNetInfo SetNetData(ScoreboardNetInfo data, [CanBeNull] PhysicalAddress target,
                                            byte scoreboardType = 255)
        {
            if (target == null)
            {
                target = BroadcastMac;
            }
            var          packetId = _messageId++;
            SetNetPacket packet   = new SetNetPacket(target, scoreboardType, packetId, new NetData(data));

            SendPacket(packet);
            var answer = ReceiveOneAnswer();

            if (answer != null && answer.MessageId == packetId)
            {
                answer = (AnsNetPacket)answer;
                // ReSharper disable once PossibleNullReferenceException there will be empty list if no messages will return;
                var answerData = (NetData)answer.Data;
                return(new ScoreboardNetInfo(answerData));
            }
            return(null);
        }