Jump to content

Omar Achraf

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by Omar Achraf

  1. hi Smoke_Eater, I was having same problem. I was using "localhost". After I changed to "127.0.0.1" my udp send message for P51D "PRIMER 1\n" worked. I'm coding with C#. My code is below: using System; using System.Net.Sockets; using System.Text; using System.Windows.Forms; namespace DCS_BIOS_Interf { class DCSSender { private const string DCS_BIOS_SEND_ADDRESS = "127.0.0.1"; private const int DCS_BIOS_SEND_PORT = 7778; UdpClient client = null; public void startSender() { client = new UdpClient(DCS_BIOS_SEND_ADDRESS, DCS_BIOS_SEND_PORT); } public void stopSender() { if (client != null) { client.Close(); } } public void send() { Byte[] sendBytes = Encoding.ASCII.GetBytes("PRIMER 1 \n"); try { client.Send(sendBytes, sendBytes.Length); } catch (Exception e) { MessageBox.Show(e.Message); } } } }
×
×
  • Create New...