diff --git a/IPython/kernel/channels.py b/IPython/kernel/channels.py index 2730f0e..b22cfba 100644 --- a/IPython/kernel/channels.py +++ b/IPython/kernel/channels.py @@ -28,29 +28,6 @@ major_protocol_version = kernel_protocol_version_info[0] class InvalidPortNumber(Exception): pass - -def make_shell_socket(context, identity, address): - socket = context.socket(zmq.DEALER) - socket.linger = 1000 - socket.identity = identity - socket.connect(address) - return socket - -def make_iopub_socket(context, identity, address): - socket = context.socket(zmq.SUB) - socket.linger = 1000 - socket.subscribe = b'' - socket.identity = identity - socket.connect(address) - return socket - -def make_stdin_socket(context, identity, address): - socket = context.socket(zmq.DEALER) - socket.linger = 1000 - socket.identity = identity - socket.connect(address) - return socket - class HBChannel(Thread): """The heartbeat channel which monitors the kernel heartbeat. diff --git a/IPython/kernel/client.py b/IPython/kernel/client.py index b9213aa..3040502 100644 --- a/IPython/kernel/client.py +++ b/IPython/kernel/client.py @@ -14,9 +14,6 @@ from IPython.utils.traitlets import ( ) from .channelsabc import (ChannelABC, HBChannelABC) -from .channels import ( - make_shell_socket, make_stdin_socket, make_iopub_socket -) from .clientabc import KernelClientABC from .connect import ConnectionFileMixin @@ -144,7 +141,7 @@ class KernelClient(ConnectionFileMixin): if self._shell_channel is None: url = self._make_url('shell') self.log.debug("connecting shell channel to %s", url) - socket = make_shell_socket(self.context, self.session.bsession, url) + socket = self.connect_shell(identity=self.session.bsession) self._shell_channel = self.shell_channel_class( socket, self.session, self.ioloop ) @@ -156,7 +153,7 @@ class KernelClient(ConnectionFileMixin): if self._iopub_channel is None: url = self._make_url('iopub') self.log.debug("connecting iopub channel to %s", url) - socket = make_iopub_socket(self.context, self.session.bsession, url) + socket = self.connect_iopub() self._iopub_channel = self.iopub_channel_class( socket, self.session, self.ioloop ) @@ -168,7 +165,7 @@ class KernelClient(ConnectionFileMixin): if self._stdin_channel is None: url = self._make_url('stdin') self.log.debug("connecting stdin channel to %s", url) - socket = make_stdin_socket(self.context, self.session.bsession, url) + socket = self.connect_stdin(identity=self.session.bsession) self._stdin_channel = self.stdin_channel_class( socket, self.session, self.ioloop ) diff --git a/IPython/qt/client.py b/IPython/qt/client.py index ed472d3..dc316f9 100644 --- a/IPython/qt/client.py +++ b/IPython/qt/client.py @@ -15,8 +15,7 @@ from IPython.external.qt import QtCore # Local imports from IPython.utils.traitlets import Type, Instance -from IPython.kernel.channels import HBChannel,\ - make_shell_socket, make_iopub_socket, make_stdin_socket +from IPython.kernel.channels import HBChannel from IPython.kernel import KernelClient from .kernel_mixins import QtKernelClientMixin