We help IT Professionals succeed at work.

How to implement this design

I need to display a realtime wave through network.

Different users may connect to the same data source(a FPGA based hardware included the IP part) at the same time through IP. Though the case is rare. The traffice for one user is big. In order to lower the output network traffic of data source harware when multi connection was built up. Is it correct to add a server between data source and user as attached.

It may involve a lot of new works. Also, I am not very sure about the design of the server program. Is there any structure I can follow. Any idea of fhow to buffer the realtime data on the server.

Any suggestion, thanks.
De.png
Comment
Watch Question

Top Expert 2016

Commented:
if you have only one server for all data sources, this server could become a bottle neck. to reduce this risk each data source and each client (user) should be handled by a different thread,  if the total of threads would exceed a threshold (for example 64 what is dependent on the computer's potential and the allover traffic), you may consider using a so-called thread-pool where the whole work is divided into small tasks which would be processed by a fixed number of threads by means of a queue.

the connection to the clients would be standard client-server, means there is one thread in the server which permanently listens for new clients and creates a server-client connection via thread or thread-pool whenever a new client was accepted.

the clients would connect to the server instead to the data source and pass their requests to the server. here probably the request data needs to be marshaled (serialized) where you could use boost library if this part should be done in c++.

a request of a client would be unmarshaled by the server and passed to the data source. at this point the logging could happen. in a new task (thread) the server would receive data from data source and return them back to the client. here serialization probably is not necessary but the data could be transferred as raw binary given that client and server both are running on compatible hardware, operation systems, compilers and project settings to avoid alignment and encoding problems.

Sara

Author

Commented:
May I know how to design a direct tunnel in server to pass through the data for each connection.

How to buffer the realtime data on server, how to manten the dynamic size of the buffer.

Any suggestion, thanks.
Top Expert 2016
Commented:
in my opinion you don't have tunnels cause in case two clients would connect to same data source you would have multiple tunnels from datasource to server what is difficult to synchronize. instead the server would buffer the returned data from data source and dispatch them to the threads (using one queue for each thread) which then redirect the results to the client which requested the data. dynamic size normally is handled that each packet has size information at begin such that the receiving thread could provide a buffer of sufficient size.

Sara