douna3367 2019-02-02 17:36
浏览 262

使用curl读取连续数据流

I can receive a data stream from a local software (race timing software) on port 50000 that looks like this (simply opened in a browser):

$B,95,"Quali"
$A,"10","10",1001,"Anneke","Kruettgen","",1
$A,"13","13",1002,"Claudia","Jasper-Perdieus","",1
$A,"25","25",1003,"Maren","Ruiters","",1
$COMP,"10","10",1,"Anneke","Kruettgen","","Ravenol TM Racing Team Gena"
$COMP,"13","13",1,"Claudia","Jasper-Perdieus","","Patch Pactory Honda"
$COMP,"25","25",1,"Maren","Ruiters","","Power 4 Suspension Husqvarna"
$C,1,"Damen"
$E,"TRACKNAME","Simulation"
$E,"TRACKLENGTH","2.000"
$F,0,"00:00:00","10:47:53","00:00:00","      "
$F,0,"00:00:00","10:47:54","00:00:00","      "

I need to read and analyse every line to build a live timing result on a display. The lines are not coming with the same rhythm, sometimes 3 lines at once, sometimes pause for 2 seconds.

I know how to read and receive a file or html source code from a webpage via curl (php) but I have now Idea how to read a continuous stream. There is no EOF or a size and I need to read this the whole day. The goal is to to bring live timing to a webpage.

Can someone guide me the way how to do it (read the data) or let my know another option instead of curl?

Basically I'm a classic webdeveloper using php, mysq, javascript and it would be helpfull to work with these languages if possible.

Thanks a lot!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 关于大棚监测的pcb板设计
    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器
    • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
    • ¥15 Vue3地图和异步函数使用