我可以在端口50000上从本地软件(竞赛计时软件)接收数据流,它看起来像这样(在浏览器中打开):
$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"," "
我需要阅读和分析每条线,以在显示器上显示实时计时结果。这些行的节奏不一样,有时会同时出现3行,有时会暂停2秒。
我知道如何通过curl(php)从网页读取和接收文件或html源代码,但是我现在知道了如何读取连续流。没有EOF或尺寸,我需要整天阅读。目的是将实时计时带到网页上。
有人可以指导我如何做(读取数据)或让我知道替代卷曲的其他方法吗?
基本上,我是使用php,mysq,javascript的经典Web开发人员,如果可能的话,使用这些语言会很有帮助。
非常感谢!