예제 #1
0
 void OnGUI()
 {
     if (GUILayout.Button("Sent"))
     {
         var package = new PingPongPackage(UDPBoxUtility.DefaultHeadBytes);
         mUDPBoxBroadcast.StartBroadcast(package.Serialize());
     }
 }
예제 #2
0
        public void Initialization(string packageHead, bool useInternalBroadcastLogic)
        {
            mUseInternalBroadcastLogic = useInternalBroadcastLogic;

            var udpClientArray = new UDPBox_UDPClient[UdpBoxEndPort - UdpBoxBeginPort];

            for (int i = 0, port = UdpBoxBeginPort; port < UdpBoxEndPort; i++, port++)
            {
                udpClientArray[i] = UDPBoxFactory.GeterateUdpClient(port);
            }
            UDPBox.Initialization(udpClientArray, packageHead);

            mEstablishConnectPackage = new EstablishConnectPackage(PackageHeadBytes);
            mPingPongPackageTemplate = new PingPongPackage(PackageHeadBytes);
            SelfIPAddress            = SelfIPAddress ?? UDPBoxUtility.GetSelfIP(BroadcastNetPrefixIP);
        }
예제 #3
0
 public PingPongHandler(byte[] packageHead)
 {
     mTemplate = new PingPongPackage(packageHead);
 }