Turkey typo correction in Sender class's init method. When assigning self.sock = sock, it was self.sock = sockd which sockd was undefined.