Socket error shown.

   public Communicator(IPAddress toconnectto)
        {
            this.toconnectto = new IPEndPoint(toconnectto, port);
            local = new IPEndPoint(Tools.GetIp(), port);
            all = new IPEndPoint(IPAddress.Any, port); 
            udpClient = new UdpClient(AddressFamily.InterNetwork);
            udpClient.Client.Bind(new IPEndPoint(Tools.GetIp(), port));
            udpClient.AllowNatTraversal(true);
            udpClient.EnableBroadcast = true;
        }

        public void SendData(string data)
        {
            try
            {
                byte[] bdata = ASCIIEncoding.ASCII.GetBytes(data);
                udpClient.Send(bdata,bdata.Length,toconnectto);
            }
            catch(Exception ex)
            {
                ;
            }
        }
           public Communicator(IPAddress toconnectto)
    {
        this.toconnectto = new IPEndPoint(toconnectto, port);
        local = new IPEndPoint(Tools.GetIp(), port);
        all = new IPEndPoint(IPAddress.Any, port); 
        udpClient = new UdpClient(AddressFamily.InterNetwork);
        udpClient.Client.Bind(new IPEndPoint(Tools.GetIp(), port));
        udpClient.AllowNatTraversal(true);
        udpClient.EnableBroadcast = true;
    }

    public void SendData(string data)
    {
        try
        {
            byte[] bdata = ASCIIEncoding.ASCII.GetBytes(data);
            udpClient.Send(bdata,bdata.Length,toconnectto);
        }
        catch(Exception ex)
        {
            ;
        }
    }   public Communicator(IPAddress toconnectto)
    {
        this.toconnectto = new IPEndPoint(toconnectto, port);
        local = new IPEndPoint(Tools.GetIp(), port);
        all = new IPEndPoint(IPAddress.Any, port); 
        udpClient = new UdpClient(AddressFamily.InterNetwork);
        udpClient.Client.Bind(new IPEndPoint(Tools.GetIp(), port));
        udpClient.AllowNatTraversal(true);
        udpClient.EnableBroadcast = true;
    }

    public void SendData(string data)
    {
        try
        {
            byte[] bdata = ASCIIEncoding.ASCII.GetBytes(data);
            udpClient.Send(bdata,bdata.Length,toconnectto);
        }
        catch(Exception ex)
        {
            ;
        }
    }   public Communicator(IPAddress toconnectto)
    {
        this.toconnectto = new IPEndPoint(toconnectto, port);
        local = new IPEndPoint(Tools.GetIp(), port);
        all = new IPEndPoint(IPAddress.Any, port); 
        udpClient = new UdpClient(AddressFamily.InterNetwork);
        udpClient.Client.Bind(new IPEndPoint(Tools.GetIp(), port));
        udpClient.AllowNatTraversal(true);
        udpClient.EnableBroadcast = true;
    }

    public void SendData(string data)
    {
        try
        {
            byte[] bdata = ASCIIEncoding.ASCII.GetBytes(data);
            udpClient.Send(bdata,bdata.Length,toconnectto);
        }
        catch(Exception ex)
        {
            ;
        }
    }

Before you do anything else fix your empty catch blocks by printing the complete details of any exception.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.