Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
http://php.net/manual/en/function.socket-recv.php
MSG_PEEK 的目的是什么,你能举个例子吗?
手册说:
从接收队列的开头接收数据而不将其从队列中删除。
因此,您可以一次又一次地读取该数据。如果几个独立的组件应该从套接字读取相同的数据,这可能很有用。如果没有此标志,数据将在您读取一次后从套接字中刷新