How To Read Data using Ip Address
I am doing punch card reader programming..
Establish connection with BioAccess V2 Device...
socket successdully connected but data can't read...
so how to read data ?
Socket sock = new Socket(AddressFamily.Int开发者_如何学GoerNetwork, SocketType.Stream,ProtocolType.Tcp);
var ipaddress = IPAddress.Parse("192.168.000.111");
IPAddress add = new IPAddress(ipaddress.GetAddressBytes());
EndPoint ep = new IPEndPoint(add, 5005);
sock.Connect(ep);
if(sock.connected)
{
}
now what i have to do in IF BLOCK to read data ?
You need to use one of the Socket.Receive
overloads to read data.
byte[] bytes = new byte[256];
try
{
int i = server.Receive(bytes);
}
精彩评论