Link to home
Start Free TrialLog in
Avatar of prashanth_gurijala
prashanth_gurijala

asked on

conversion vs.net C# TO vb.net

i have no idea about c#. Can any one help me in converting this c# code to vb.net

thanx in advance,
prashanth


using System;
using System.Net;
using System.Net.Sockets;

namespace UdpEchoServer
{
    class App
    {
        private const int ServerPortNumber = 9696;

            [STAThread]
        static void Main(string[] args)
        {
            try {
                Socket udpSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);

                        EndPoint localEP = new IPEndPoint(IPAddress.Any, ServerPortNumber);
                EndPoint remoteEP = new IPEndPoint(IPAddress.None, ServerPortNumber);
                udpSocket.Bind(localEP);

                byte [] receiveBuffer = new byte [512];
                try
                        {
                    while (true)
                              {
                        int receivedSize = udpSocket.ReceiveFrom(receiveBuffer, ref remoteEP);
                        udpSocket.SendTo(receiveBuffer, receivedSize, SocketFlags.None, remoteEP);
                    }
                }
                        finally
                        {
                    udpSocket.Close();
                }
                        }
                        catch (SocketException se)
                        {
                              Console.WriteLine(se.ToString());
                        }
        }
    }
}
Avatar of fulp02
fulp02

I could help you but , not through EE Cause I don't know all the specifics of VB.Net But if you do i can tell you what it is then you can write it in VB.
AIM: FuLP02
Email: chris@chesapeakesoft.com

Shoot Me a message if you want to do it.
ASKER CERTIFIED SOLUTION
Avatar of tusharashah
tusharashah

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial