I understand that hopen opens either a file or an IPC connection to another kdb process. Is there any way to open a simple character connection to a network host, ala telnet? I also saw that one could use the following syntax: `:http://hostname “GET x” to open a character connection and retrieve a response (in this case HTML from a HTTP server), but I don’t know if there is a different syntax to keep the connection open? I am trying to open a session with a server that speaks a simple textual protocol and would prefer to do it in q.
Thanks in advance,
Victor
Thanks, John. I am actually not trying to connect to another kdb process, but to a server that uses a textual protocol, like HTTP or SMTP (for example). Conceptually, it’s basically the same as sending strings synchronously back and forth like in your example, except without the serialization.
Hi Victor,
I think your only option for a constantly open connection is to extend kdb with some C code. The rserve code allows connecting and sending text commands to an R server from within q, it may be useful to look at.
http://code.kx.com/wsvn/code/cookbook_code/r/rserve/
If you just wanted to synchronously download some data, you could use a command line tool from within q to download it to file, then read the file.
Regards,
Ryan
On 5/3/2013 5:40 AM, Victor Wong wrote:
Thanks, John. I am actually not trying to connect to another kdb process, but to a server that uses a textual protocol, like HTTP or SMTP (for example). Conceptually, it’s basically the same as sending strings synchronously back and forth like in your example, except without the serialization.
On Thursday, May 2, 2013 6:13:47 PM UTC-7, John Dempster wrote:
You can send strings of commands using the handle hopen returns.
See the IPC example video here http://www.timestored.com/kdb-guides/interprocess-communication
~JD
On Friday, May 3, 2013 2:05:51 AM UTC+1, Victor Wong wrote:
I understand that hopen opens either a file or an IPC connection to another kdb process. Is there any way to open a simple character connection to a network host, ala telnet? I also saw that one could use the following syntax: `:http://hostname “GET x” to open a character connection and retrieve a response (in this case HTML from a HTTP server), but I don’t know if there is a different syntax to keep the connection open? I am trying to open a session with a server that speaks a simple textual protocol and would prefer to do it in q.
Thanks in advance,
Victor
–
You received this message because you are subscribed to the Google Groups “Kdb+ Personal Developers” group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbplus+unsubscribe@googlegroups.com.
To post to this group, send email to personal-kdbplus@googlegroups.com.
Visit this group at http://groups.google.com/group/personal-kdbplus?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--
TimeStored.com - KDB+ Training, Consulting, Software
You can look about here:
http://code.kx.com/wsvn/code/contrib/rpairceir/KDB%20TCP/?#af1754533edd3a736885f54cb836c52b3
Just a simple code where a C based TCP data feeder sending random strings to a q session. Hopefully it can help you though.