My fwrite to a socket is not flushed, until the socket closes. How to change?

后端 未结 1 600
余生分开走
余生分开走 2021-01-19 05:16

My fwrite to a socket is not flushed, until the socket closes. How to change? I want it to flush after each fwrite.

I\'ve tried:

1) flush()
2) fflush()

相关标签:
1条回答
  • 2021-01-19 06:07

    There is a function for that! fflush($rc)

    Did you make sure you had the correct resource as the parameter?

    edit

    Okay. looking at your code you are using socket_* functions. You need to use fsockopen, fwrite, fflush, fsockclose. Your code should work the same, but you will be able to flush output. check out the example in the php manual for more details.

    0 讨论(0)
提交回复
热议问题