Add PORT command line argument
Fix segfault

Message len was not updated when iterating in on_read_bytes