Seperated the port opening from the message sending