Good, I'm fiddling with a biometric fingerprint sensor, my intention is to get the data through a program. But I've found that to begin with, even though I can ping him, I can not communicate with him using the Socket class.
static void ProbarConexion(){
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp);
s.Connect("192.168.1.224", 52925);
if (!s.Connected)
{
Console.WriteLine("Imposible conectar");
}
if (s.Poll(-1, SelectMode.SelectWrite))
{
Console.WriteLine("Se puede escribir");
}
else if (s.Poll(-1, SelectMode.SelectRead))
{
Console.WriteLine("Se puede leer");
}
else if (s.Poll(-1, SelectMode.SelectError))
{
Console.WriteLine("Error");
}
}
Any ideas? From that code, I'm missing an exception that could not be answered.
Say that in the device I have it configured with the ip address and the port that I have put in the code, come on, that ping using the cmd goes well.