I would like to connect to a specific barcode reader at my work but currently I'm facing some problems to understand how TCP stream reading works with C#.
I've looked for many code samples on stackoverflow and as I can see, people oftenly open a connection, send a command and then ask for the reply.
The point is, the barcode reader just accept a TCP connection and then send the data with my data.
I would like find the most efficient way to use TcpClient or NetworkStream to read in a continuous way the data. I mean, I would like to listen for the data when it's incoming but also process many other things at the same time I'm listening.
I was wonderning if simple TCP libraries exists like a one with a Connect function, and an event firing when you receive data (with a delimiter or with a length).
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…