public void SendData(byte[] buffer, int size) { udpClient.sendBufferSize = size; for (int i = 0; i < size; i++) { udpClient.sendBuffer[i] = buffer[i]; } int sent = udpClient.SendTo(target); }
private void NetworkLoop() { while (status == NetworkStatus.Active) { //Debug.Log(status); udpClient.Receive(); SendSocketData(); int sent = udpClient.SendTo(multicastEndPoint); //Debug.Log(sent + " bytes sent"); Thread.Sleep(NETWORK_SLEEP); } udpClient.Close(); }