def create_n_connect(self,<EOL>socket_type,<EOL>address: str,<EOL>bind=False,<EOL>on_error='<STR_LIT>',<EOL>socket_name='<STR_LIT>'):
self.logger.debug('<STR_LIT>',<EOL>socket_type, socket_name, address)<EOL>socket = self.context.socket(socket_type)<EOL>if self.using_auth:<EOL><INDENT>self._create_using_auth(socket, address, bind, on_error, socket_name)<EOL><DEDENT>else:<EOL><INDENT>self._create_no_auth(socket, address, bind, on_error, socket_name)<EOL><DEDENT>return socket<EOL>
Creates and connects or binds the sockets
on_error:
    'log': will log error
    'exit': will exit the program
socket_name:
    used for troubleshooting/logging