It is necessary to use flask to develop a web program that accepts TCP data in the background, extracts the valid content from the data and displays it on the page in real time, and asks for guidance.

beginners are recently trying to make a web program for company testing. Now they have developed a basic page with the self-taught flask framework. Now they need to implement the backend to receive data from another server in real time through TCP, extract the contents of the data and dynamically display them in a page list (the list contains operations to add and delete items), and they don"t know exactly what to do yet. Looking up information on the Internet in the past two days, I probably see two ways, one is to use socketio for front-end and background interaction, and the other is to use ajax to poll the display content, for guidance which method is more suitable for my problem solving?

May.22,2021

http://www.runoob.com/w3cnote.
this is the timer of js, which can execute the task regularly. It is recommended to define the ajax dynamic rendering page in the task.

there is one thing that is not very clear

is dynamically displayed in a list of pages (the list contains operations to add and delete items)

what does this mean and why do you add and delete dynamic content?
if you start to record A, click and delete, and before you can wait for the result of deletion, the page will be refreshed, which always feels strange.

feels that your TCP should be a long connection. Do you need to borrow a redis or something to store temporary results


whether you use websocket or ajax, you can achieve your needs.

I happen to have a flask websocket project attempt here. The code is https://github.com/eastossifr.

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3da5d-34778.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3da5d-34778.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?