[IPython-dev] XREQ/XREP socets

Sean Ross-Ross srossross at gmail.com
Mon Aug 29 14:18:47 EDT 2011


Hello, I've been playing around with the new socketed API and I have a few questions. 

My end goal is to create a simple javascript server. But for now I'm trying to see if I understand how the sockets work.

In my testing I start an ipython kernel:
$ ipython qtconsole
[IPKernelApp] To connect another client to this kernel, use:
[IPKernelApp] --existing --shell=49785 --iopub=49786 --stdin=49787 --hb=49788

Then, in another terminal I try to send a command manually to the shell socket (using python):

import socket
import json

shell_sock = socket.create_connection(('localhost',49785))
header = { 'msg_id' : 'uuid-123', 'username': 'sean', 'session': '??', 'msg_type': 'connect_request', }

msg = dict(parent_header=parent_header, header=header, content=content)

msg_str = json.dumps(msg)

shell_sock.send(msg_str)
shell_sock.recv(1024**2)


This does not work, and I do not get any response. Why? I would use zmq but the server is implemented in javascript.  I also can not use ajax or jquery from the client-side html notebook app because this is on the server side.

Thanks in advance.
~Sean

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20110829/80388795/attachment.html>


More information about the IPython-dev mailing list