-
Integrating Socket Handles from C Library into kdb+ for WebSocket Management
I have a shared C library that contains a function capable of opening WebSocket connections and performing socket-level operations, such as binding the socket to a different local IP address or change other socket related options.
While the C function successfully creates the WebSocket connection and allows for various socket manipulations, I cannot integrate this handle value within kdb+.
The Problem
- C Functionality: The C function creates a WebSocket connection and can perform operations like binding the socket to different IP addresses, which I cannot do in Q directly (as far as I am aware).
- Integration Challenge: Despite being able to pass the handle value from the C function back to the Q process, I am unable to use this handle within kdb+. (Which is not surprising of course)
- Alternative Approach Attempted: I have also tried creating the socket connection in Q, as usual, and then passing the handle value to the shared library to perform socket-level changes. However, this approach does not allow me to bind the socket to a different IP address.
Question
Is there a way to “register” or otherwise integrate a socket handle created and returned by a shared C library function so that it can be recognised and managed by kdb+? Or is there another way to modify socket options.
Any guidance or examples on how to achieve would be great, thanks.
Log in to reply.