lucarda / pd-websocketserver Goto Github PK
View Code? Open in Web Editor NEWwebsocket server for Pd
License: GNU General Public License v3.0
websocket server for Pd
License: GNU General Public License v3.0
Building and testing on a 10.10 hackintosh. There's a osx-10.10 branch with some #ifdef for apple.
It seems the problem is when entering the base64_encode()
function :
I get a segfault.
This is the debugger:
(lldb) target create "./pd"
Current executable set to './pd' (x86_64).
(lldb) run
Process 856 launched: './pd' (x86_64)
Process 856 stopped
* thread #5: tid = 0x27db, 0x00007fff90fc4f4f Heimdal`base64_encode + 277, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x00007fff90fc4f4f Heimdal`base64_encode + 277
Heimdal`base64_encode:
-> 0x7fff90fc4f4f <+277>: movq %rax, (%r14)
0x7fff90fc4f52 <+280>: movq %rax, %rdi
0x7fff90fc4f55 <+283>: callq 0x7fff90fe6bf4 ; symbol stub for: strlen
0x7fff90fc4f5a <+288>: jmp 0x7fff90fc4f68 ; <+302>
(lldb) bt
* thread #5: tid = 0x27db, 0x00007fff90fc4f4f Heimdal`base64_encode + 277, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
* frame #0: 0x00007fff90fc4f4f Heimdal`base64_encode + 277
frame #1: 0x0000000100279976 websocketserver.pd_darwin`get_handshake_accept + 214
frame #2: 0x0000000100279ab8 websocketserver.pd_darwin`get_handshake_response + 232
frame #3: 0x000000010027a9ca websocketserver.pd_darwin`ws_establishconnection + 234
frame #4: 0x00007fff86a422fc libsystem_pthread.dylib`_pthread_body + 131
frame #5: 0x00007fff86a42279 libsystem_pthread.dylib`_pthread_start + 176
frame #6: 0x00007fff86a404b1 libsystem_pthread.dylib`thread_start + 13
The functions onopen
, onclose
and onmessage
seem to be called from the network thread, but they call Pd API methods that are not thread-safe, e.g. outlet_list
or outlet_float
. You have to either
a) protect Pd with sys_lock
+ sys_unlock
before/after calling such methods
or
b) use a thread-safe queue which is polled regularly from Pd's scheduler with a clock.
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.