Which involves the problems are:
1, the current table to read the table, A how to find A table from many sockets corresponding SOCKET
2, when there are multiple computer each open A browser, A table return meter reading data, how to return to the computer browser read A table?
CodePudding user response:
Isn't 1. Direct database it is, isn't it time to report to the database, web site to read database data???????2. You can use the websocket connection, can save tags, by tagging to push information corresponding to the browser
CodePudding user response:
DTU connection in use long connection, the background using netty building a server, can send instructions or automatically report, the background of data caching;Front and back by the websocket connection, the background can push message directly to the front; If it's not the websocket, front end using polling queries can,
CodePudding user response:
1 DTU report information, will take a meter ID, this ID in the management of the electric meter system is which user can find, front desk don't read the socket, the corresponding web interface2 when there are multiple computer each open A browser, this is impossible, multiple browser query A table of data at the same time, it's just A browser open the same page
DTU can realize the TCP, UDP is very good, cheap processor to realize HTTP client more than implemented TCP/UDP client a lot of development work,
According to asynchronous (message) treatment development, DTP sent a message (probably a UDP implementation), is a one-way message, does not require a certain instant return
Can send messages, DTU DTU Id and the client IP cached, there are downside news, sending a message from the cache to find IP
CodePudding user response: