Example #1
0
 void InitSocket()
 {
     socket = UDP.Create(bufferSize, bufferSize);
     UDP.SetDontFragment(socket);
     UDP.SetNonBlocking(socket);
     needsDisposing = true;
 }
Example #2
0
 // Use this for initialization
 public void setup()
 {
     //udp = this.gameObject.GetComponent<UDP>();
     if (udp == null)
     {
         udp = this.gameObject.AddComponent <UDP>();
     }
     if (!udp.IsOpen())
     {
         udp.Setup();
         udp.SetupSender(ip, sendPort);
         udp.Create();
     }
 }
Example #3
0
    public void setup()
    {
        udp = this.gameObject.GetComponent <UDP>();
        if (udp == null)
        {
            udp = this.gameObject.AddComponent <UDP>();
        }
        if (!udp.IsOpen())
        {
            udp.Setup();
            udp.SetupReceiver(receivePort);
            //udp.SetReceiveDataHandler(OnReceiveData);
            //udp.SetReceivePacketHandler(OnReceivePacket);
            udp.SetReceiveDataQueueHandler(OnReceiveDataQueue);

            udp.Create();
        }
    }
Example #4
0
 // Use this for initialization
 void Start()
 {
     udp.Setup("127.0.0.1", 11999, 11999);
     udp.SetReceivePacketHandler(OnReceivePacket);
     udp.Create();
 }