I'm new to sockets and network programming so if the question seems dumb, that's because I don't fully understand the above mentioned topics.
Need to continuously send telemetry data over a network. Don't really care who is going to get it, just need to send it out. All the client needs to do is simply to connect to a specific IP and get data from a specific port and the data will be received by it.
My code is written in C
.
Originally I thought it would be a UDP socket. But it has recvfrom
method, i.e. I (server) need to wait till someone connects to it. Then I decided to look at TCP/IP socket but this one has an accept
method.
I looked online for quite some time but didn't find any code that could help me out (maybe I was looking in a wrong place).
Does anyone know if what I'm talking about is possible to do? If so how would I do it? If no, then are there any other ways to do it, i.e. by not using sockets
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…