payden / php-ws Goto Github PK
View Code? Open in Web Editor NEWPHP extension for writing WebSocket servers in PHP.
License: Other
PHP extension for writing WebSocket servers in PHP.
License: Other
I need to start an external process to handle the message queue, and connected to WebSocketServer and communications.
can not compile (make) with this error
cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/ws.so -bundle .libs/ws.o .libs/php_ws.o -L/lib /usr/local/lib/libwebsock.dylib /usr/local/lib/libevent_openssl.dylib /usr/local/lib/libevent.dylib /usr/local/lib/libevent_pthreads.dylib -Wl,-rpath -Wl,/lib
ld: warning: directory not found for option '-L/lib'
duplicate symbol _ws_object_handlers in:
.libs/ws.o
.libs/php_ws.o
duplicate symbol _ws_client_object_handlers in:
.libs/ws.o
.libs/php_ws.o
duplicate symbol _ws_message_object_handlers in:
.libs/ws.o
.libs/php_ws.o
ld: 3 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Hi Payden,
I have a web application written in PHP that uses long polling to send data out to the clients, this uses one process per client, looking for changes in a DB. Returning either data or a 204 HTTP response after some timeout after which the clients connect again.
It uses a lot of resources and I have long been looking for a good way implement an event based Websocket solution, without having to redo all my existing php code.
After trying the echo example with your php-ws extension I think this extension could be very useful, but I somehow lack a method of interrupting the event loop if new data becomes available on the server.
So I would like to do one of the following if it is possible:
Is any of this possible?
As far as I can see I can interrupt the process with a INT signal, but that would require another process to do this or am I wrong?
Otherwise the extension works very well, and I believe it is a lot faster to handle the low level websocket details in C, rather than in a high level PHP script.
Thank you very much.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.