title: Asp.net Error: System.Net.Sockets.SocketException: No such host is known
body: <p>I'm doing some tests to work with SignalR. The results are successful when I do the tests on localhost, but when I publish on the production server, I get the following error:</p>
  
  <p>ERROR MESSAGE BELOW:</p>
  
  <pre><code>No such host is known 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  
  Exception Details: System.Net.Sockets.SocketException: No such host is known
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/eBQbU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eBQbU.png" alt="enter image description here"></a>
  The way I started is as follows:</p>
  
  <ul>
  <li>First I downloaded the signalR packets</li>
  <li><p>Then I created the Startup file:</p>
  
  <pre><code>using System;
  using System.Threading.Tasks;
  using Microsoft.Owin;
  using Owin;
  
  [assembly: OwinStartup(typeof(MvcMasterPrueba.Startup))]
  
  namespace MvcMasterPrueba
  {
     public class Startup
     {
      public void Configuration(IAppBuilder app)
      {
          //ConfigureAuth(app);
          app.MapSignalR();
      }
    }
  }
  </code></pre></li>
  </ul>
  
  <p>Hub file:</p>
  
  <pre><code>    using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Web;
      using Microsoft.AspNet.SignalR;
  
      namespace MvcMasterPrueba
      {
      public class MyHub : Hub
      {
          public void Send(string name, string message)
          {
              Clients.All.broadcastMessage(name, message);
          }
  
          public void BroadcastMessageToAll(string nombreImpresora, String divHTML)
          {
              //Clients.All.newMessageReceived(message);
              Clients.All.imprimeDiv(nombreImpresora, divHTML);
  
          }
          public void BroadcastMessageToPrinter(string nombreImpresora, String divHTML)
          {
              Clients.All.imprimeDiv(nombreImpresora, divHTML);
          }
  
          public void JoinAGroup(string group)
          {
              Groups.Add(Context.ConnectionId, group);
          }
  
          public void RemoveFromAGroup(string group)
          {
              Groups.Remove(Context.ConnectionId, group);
          }
  
        }
      }
  </code></pre>
  
  <p>I get the error just when I publish on the server, and when I try to login. That is to say in this part:</p>
  
  <pre><code>    public ActionResult Acceder(string User, string Pass)
          {
              string estado = "0";
              string ip = "";
              string db = "";
              string user = "";
              string pass = "";
              string password = "";
              string sql = "SELECT ip,db,user,CONVERT(AES_DECRYPT(`pass`,'1234444444') USING UTF8) AS pass,password " +
                           "FROM usuarios " +
                           "WHERE email='" + User + "' and password='" + Pass + "' limit 1";
              conexion.conectar();
              MySqlDataAdapter datos = new MySqlDataAdapter(sql, conexion.conlogin);
              conexion.cerrar();
              DataTable dt = new DataTable();
              datos.Fill(dt);
              foreach (DataRow row in dt.Rows)
              {
                  ip = row[0].ToString();
                  db = row[1].ToString();
                  user = row[2].ToString();
                  pass = row[3].ToString();
                  password = row[4].ToString();
              }
              if (Pass == password)
              {
                  Session["Session_User"] = User;
                  Session["ip"] = ip;
                  Session["db"] = db;
                  Session["user"] = user;
                  Session["pass"] = pass;
                  estado = "1";
                  Session["ss_nro_caja"] = obtieneNroCaja();
              }
              switch (estado)
              {
                  case "0":
                      ViewData["Mensaje"] = "Usuario o Password invalido..!!";
                      return View("Login");
                  case "1":
                      FormsAuthentication.SetAuthCookie(User, false);
                      return RedirectToAction("Home", "Acceso");
                  default:
                      return View("Login");
              }
          }
  </code></pre>
  
  <p>So I get this case:</p>
  
  <pre><code>    case "1":
                      FormsAuthentication.SetAuthCookie(User, false);
                      return RedirectToAction("Principal", "Acceso");
  </code></pre>