Networking related question

Hello Rooters,

I want to create a DAQ-System that optionally sends the acquired data over the inet to several clients using ROOT classes like TSocket.

I have been studiing the Networking chapter of the users guide, the /tutorials/spy.c and /tutorials/hserv.c with the related files and some topics here in the RootTalk Forum. I also investigated the Go4 Project from GSI, but this was too complex for me to understand.

I am pretty unexperienced in this networking buisness, thats why I have some general questions:

From what I have learned so far, the communication always works this way:
-client asks server for specific stuff.
-server (wich is waiting for such an request) answers with the specific stuff
-client now gets the data.

Isn’t there a way, that the server just sends the data to a socket and doesn’t care about wether there is a client waiting for the data? I am thinking of such an scenario:
-server is always sending data to a socket
-client connects to this socket and reads the data that gets send to the socket and has to care that it gets everything it needs itself (meaning not interrupting the server with requests and stuff).

Please tell me if this is a possible scenario, or if this is not possible.
If it is possible, are there some small examples like the tutorials mentioned above, that give a greater inside of how such an scenario is acomplished?

Thank you

Lutz

I haven’t done any networking stuff with ROOT, so don’t know its capabilities.

However, I can a way of doing this in ‘normal’ internet-land (ie non-ROOT) internet-land. Whether they can be implimented in ROOT is another matter…

One way is similar to web-casting, using UDP. This is a much more bare-bones protocol than TCP that is stateless and connectionless - you just fire data away and assume it got somewhere, which is just what you require. However, it doesn’t guarantee delivery, order or integrity of data, so that’s up to you.

There’s loads on the web about UDP - you might need to write a UDP network class if ROOT hasn’t got one but it shouldn’t be too hard.

ROOT does indeed not (yet) have an UDP networking interface. Currently the TSocket class is TCP only, and with TCP you need to have the sockets connected on both sides before you can write data into it.

Cheers, Fons.

I am doing a similar thing. I’m writing code to connect to a socket broadcasting data, and process the data stream. I’m using TSocket for the connection. In order for this to work, I need to make sure that I’m reading data faster than it is being sent to me. Is there a way to check how full TSocket’s receive buffer is? I couldn’t find anything about this in the users guide / class reference, etc.

Thanks,
Jason