SOXXY: a daemon stated IRC client project
I believe enc = enc() is considered an anti-pattern, because the semantics of enc changes. I'd suggest renaming the variable to encoding.

Rather than a long if..elif..else block you could use a simple handle_operation(op) call.

Since there's effectively no exception handling it will be difficult to diagnose errors.

Using argparse would make it possible to understand how to use the code without reading it. As a bonus it adds -h/--help support by default so users can see what the expected call structure is.

sleeping to wait for an end point to be available is an anti-pattern. To guarantee that an end point is up and that you get started processing as quickly as possible it's common to poll the end point until it responds correctly or fail if there's a timeout.