kphp icon indicating copy to clipboard operation
kphp copied to clipboard

PHP WebSockets

Open hossein-zare opened this issue 5 years ago • 2 comments

Hello, is WebSocket (the socket_create() function and some other funcs) supported or not implemented?

hossein-zare avatar Jan 25 '21 22:01 hossein-zare

PHP's socket_create() function is to WebSockets, which specifies additional framing, like chalk is to cheese. WS implementations can be very small (mine is ~100 lines), but it's definitely not built in.

As an aside, I personally find the sockets extension very... idiosynchratic, and tend to strongly prefer the stream_ functions everywhere I can.

/functions.txt currently only lists stream_socket_client, suggesting that stream_socket_server is yet to be implemented. (Note, that link goes to a1c816, which was current as of writing this comment.)

exikyut avatar Apr 03 '21 09:04 exikyut

PHP's socket_create() function is to WebSockets, which specifies additional framing, like chalk is to cheese. WS implementations can be very small (mine is ~100 lines), but it's definitely not built in.

As an aside, I personally find the sockets extension very... idiosynchratic, and tend to strongly prefer the stream_ functions everywhere I can.

/functions.txt currently only lists stream_socket_client, suggesting that stream_socket_server is yet to be implemented. (Note, that link goes to a1c816, which was current as of writing this comment.)

Can you please share websocket client implementation?

giosh04 avatar Mar 27 '22 01:03 giosh04