예제 #1
0
		public void SendPackage(PackageOut pkg)
		{
			NetManager.sendFunction(pkg);
		}
예제 #2
0
		public void Send(PackageOut pkg)
		{
			if (Connected)
			{
				pkg.Pack();
				if (_encrypted)
				{
					for (int i = 0; i < pkg.length; i ++)
					{
						if (i > 0)
						{
							SEND_KEY[i % 8]= (byte)((SEND_KEY[i % 8] + pkg.Get(i - 1)) ^ i);
                            pkg.Set(i, (byte)((pkg.Get(i) ^ SEND_KEY[i % 8]) + pkg.Get(i - 1)));
						}
						else
						{
                            pkg.Set(0, (byte)(pkg.Get(0)^SEND_KEY[0]));
						}
					}
				}
				_socket.Send(pkg.ToByteArray());
			}
		}
예제 #3
0
        public void SendPackage(PackageOut pkg)
        {
            _socket.Send(pkg);

            Log.Debug("Socket SendPackage: [" + pkg.code.ToString() + "," + BitConverter.ToString(pkg.GetByteArray(0, pkg.length)) + "]");
        }
예제 #4
0
 public void SendPackage(PackageOut pkg)
 {
     var r = new HTTP.Request("GET", _url, pkg.ToByteArray());
     r.Send(_OnResponse);
     Log.Debug("Socket SendPackage: [" + pkg.code.ToString() + "," + BitConverter.ToString(pkg.GetByteArray(0, pkg.length)) + "]");
 }