def socket(self, mode=3, stream=None, heartbeat=None):
        # build connection url
        if stream is None:
            url = make_uri(self.server.uri, '/%s/channel' % self.pid,
                mode=mode)
        else:
            url = make_uri(self.server.uri, '/%s/channel/%s' % (self.pid,
                stream), mode=mode)
        url = "ws%s" % url.split("http", 1)[1]

        # build connection options
        options = {}
        if heartbeat and heartbeat is not None:
            options['heartbeat'] = heartbeat

        # eventually add sll options
        if is_ssl(url):
            options['ssl_options'] = parse_ssl_options(self.server.options)

        return IOChannel(self.server.loop, url, mode=mode,
                api_key=self.server.api_key, **options)
Override to add additional logic. Does nothing by default.
dataset/ETHPy150Open benoitc/gaffer/gaffer/httpclient/process.py/Process.socket--crossover with--dataset/ETHPy150Open django-import-export/django-import-export/import_export/resources.py/Resource.before_import