code: def bind_socket(sock, channel='can0'):
      
      log.debug('Binding socket to channel=%s', channel)
      if HAS_NATIVE_SUPPORT:
          sock.bind((channel,))
      else:
          # For Python 2.7
          addr = get_addr(sock, channel)
          libc.bind(sock.fileno(), addr, len(addr))
      log.debug('Bound socket.')
docs: Binds the given socket to the given interface.
  
      :param socket.socket sock:
          The socket to be bound
      :raises OSError:
          If the specified interface isn't found.