コード例 #1
0
ファイル: UdpMessage.cs プロジェクト: zeud/Chatime
 public UdpDatagram(UdpDatagramType notice, string filePath, string FromAddr, string ToAddr)
 {
     Type        = notice;
     FromAddress = FromAddr;
     ToAddress   = ToAddr;
     HostName    = Dns.GetHostName();
     Message     = filePath;
 }
コード例 #2
0
        /// <summary>
        /// Send the file transfer related notice to a recipient
        /// </summary>
        /// <param name="notice">FSendReq,FAccept,FRefuse</param>
        /// <param name="filePath">Sending file path</param>
        /// <param name="recIP">Recipient IP address</param>
        public void SendFileNotice(UdpDatagramType notice, string filePath, IPAddress recIP)
        {
            IPEndPoint recEP = new IPEndPoint(recIP, udport);

            udpSender.SendMessage(new UdpDatagram(notice, filePath, LocalIPAddress.ToString(), recIP.ToString()), recEP);
        }
コード例 #3
0
        /// <summary>
        /// Multicast the UDP notice
        /// </summary>
        /// <param name="notice">OnLine,OffLine</param>
        public void MultiCastNotice(UdpDatagramType notice)
        {
            IPEndPoint groupEP = new IPEndPoint(GroupIPAddress, udport);

            udpSender.MultiCast(new UdpDatagram(notice, "", LocalIPAddress.ToString(), GroupIPAddress.ToString()), groupEP);
        }