Thread for reading from a socket


I am creating a binding for the Arcam amplifier/streamer/AVR devices.

Functionally most if it is working so I’m now doing some cleanup and device specific workarounds.
In the developer guidelines I read that I’m not supposed to use my own thread and otherwise post a message here.
I now have a Thread that reads from a Socket in a while loop, as the Arcam products use raw TCP sockets for their communication.
What would be a good alternative for this to use instead of a Thread?


You can check my Intesis binding (intesisBoxApi) for reference.

1 Like

Thanks for your reply.

I see you are also using a Thread:

public class IntesisBoxSocketApi {
Thread tcpListener = new Thread(new TCPListener());

I’m fine with doing this, so if I get no comments that state this is wrong I’ll keep my code as is.

As it was merged the way it is, this should be fine.
Just don‘t forget to name the thread in the correct way.

Thanks for mentioning the thread naming, I did not have that yet.