'Send raw data to the controller.
Generally, data is a bytes object. If not, we check if it has a pack()
method and call it (hoping the result will be a bytes object).  This
way, you can just pass one of the OpenFlow objects from the OpenFlow
library to it and get the expected result, for example.'

def send(self, data):

    if (type(data) is not bytes):
        if hasattr(data, 'pack'):
            data = data.pack()
    self.io_worker.send(data)
