Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Fixed it here is the solution if anyone wants to learn how I fixed it.. Please note this is probably the only UDP Proxy on all of google if you stumbled upon this.. that is coded in C#.. easily ported to VB.NET with online .NET converter</p> <p>Be happy this code works ;)</p> <p>Sure it's not efficient because it doesn't use events.. like ReceiveAsync/EndReceive.</p> <p>Only downfall to not using Aysnchronize events.. is that you see below the working code.. will have to be stuck in a infinite loop.. and it will burn your CPU cycles.. easily fixed with a Thread.Sleep(10).. (don't set to high or you will have udp lag)</p> <pre><code>using System; using System.Collections.Generic; using System.Text; using System.Net.Sockets; using System.Net; namespace UdpProxy { class Program { public static IPEndPoint m_listenEp = null; public static EndPoint m_connectedClientEp = null; public static IPEndPoint m_sendEp = null; public static Socket m_UdpListenSocket = null; public static Socket m_UdpSendSocket = null; static void Main(string[] args) { // Creates Listener UDP Server m_listenEp = new IPEndPoint(IPAddress.Any, 7900); m_UdpListenSocket = new Socket(m_listenEp.Address.AddressFamily, SocketType.Dgram, ProtocolType.Udp); m_UdpListenSocket.Bind(m_listenEp); //Connect to zone IP EndPoint m_sendEp = new System.Net.IPEndPoint(IPAddress.Parse("REMOTE_IP_GOES_HERE"), 7900); m_connectedClientEp = new System.Net.IPEndPoint(IPAddress.Any, 7900); byte[] data = new byte[1024]; while (true) { if (m_UdpListenSocket.Available &gt; 0) { int size = m_UdpListenSocket.ReceiveFrom(data, ref m_connectedClientEp); //client to listener if (m_UdpSendSocket == null) { // Connect to UDP Game Server. m_UdpSendSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); } m_UdpSendSocket.SendTo(data, size, SocketFlags.None, m_sendEp); //listener to server. } if (m_UdpSendSocket != null &amp;&amp; m_UdpSendSocket.Available &gt; 0) { int size = m_UdpSendSocket.Receive(data); //server to client. m_UdpListenSocket.SendTo(data, size, SocketFlags.None, m_connectedClientEp); //listner } } // Wait for any key to terminate application Console.ReadKey(); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload