This commit is contained in:
zandercymatics 2023-10-11 12:58:00 -06:00
parent 1550fde832
commit af852125f8
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
6 changed files with 1131 additions and 737 deletions

View file

@ -0,0 +1,25 @@
from geventconnpool import ConnectionPool
from epplibwrapper.socket import Socket
class EppConnectionPool(ConnectionPool):
def __init__(self, client, login, options):
# For storing shared credentials
self._client = client
self._login = login
super().__init__(**options)
def _new_connection(self):
socket = self.create_socket(self._client, self._login)
try:
connection = socket.connect()
return connection
except Exception as err:
raise err
def _keepalive(self, connection):
pass
def create_socket(self, client, login) -> Socket:
"""Creates and returns a socket instance"""
socket = Socket(client, login)
return socket