OXIESEC PANEL
- Current Dir:
/
/
lib
/
python3.6
/
site-packages
/
pymysql
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/07/2025 11:05:01 PM
rwxr-xr-x
📄
__init__.py
4.62 KB
09/10/2020 07:27:13 AM
rw-r--r--
📁
__pycache__
-
02/16/2024 09:01:03 PM
rwxr-xr-x
📄
_auth.py
9.34 KB
09/10/2020 07:05:22 AM
rw-r--r--
📄
_compat.py
481 bytes
03/26/2018 07:46:10 AM
rw-r--r--
📄
_socketio.py
3.95 KB
03/26/2018 07:46:10 AM
rw-r--r--
📄
charset.py
10.07 KB
11/21/2019 07:24:15 AM
rw-r--r--
📄
connections.py
47.86 KB
12/18/2023 10:54:02 AM
rw-r--r--
📁
constants
-
02/16/2024 09:01:03 PM
rwxr-xr-x
📄
converters.py
10.8 KB
09/09/2020 06:41:09 AM
rw-r--r--
📄
cursors.py
15.87 KB
09/10/2020 07:05:12 AM
rw-r--r--
📄
err.py
3.65 KB
09/09/2020 06:41:09 AM
rw-r--r--
📄
optionfile.py
658 bytes
03/26/2018 07:46:10 AM
rw-r--r--
📄
protocol.py
11.79 KB
11/12/2019 12:51:10 PM
rw-r--r--
📄
times.py
360 bytes
08/29/2016 11:57:13 AM
rw-r--r--
📄
util.py
180 bytes
12/18/2018 09:58:59 AM
rw-r--r--
Editing: _socketio.py
Close
""" SocketIO imported from socket module in Python 3. Copyright (c) 2001-2013 Python Software Foundation; All Rights Reserved. """ from socket import * import io import errno __all__ = ['SocketIO'] EINTR = errno.EINTR _blocking_errnos = (errno.EAGAIN, errno.EWOULDBLOCK) class SocketIO(io.RawIOBase): """Raw I/O implementation for stream sockets. This class supports the makefile() method on sockets. It provides the raw I/O interface on top of a socket object. """ # One might wonder why not let FileIO do the job instead. There are two # main reasons why FileIO is not adapted: # - it wouldn't work under Windows (where you can't used read() and # write() on a socket handle) # - it wouldn't work with socket timeouts (FileIO would ignore the # timeout and consider the socket non-blocking) # XXX More docs def __init__(self, sock, mode): if mode not in ("r", "w", "rw", "rb", "wb", "rwb"): raise ValueError("invalid mode: %r" % mode) io.RawIOBase.__init__(self) self._sock = sock if "b" not in mode: mode += "b" self._mode = mode self._reading = "r" in mode self._writing = "w" in mode self._timeout_occurred = False def readinto(self, b): """Read up to len(b) bytes into the writable buffer *b* and return the number of bytes read. If the socket is non-blocking and no bytes are available, None is returned. If *b* is non-empty, a 0 return value indicates that the connection was shutdown at the other end. """ self._checkClosed() self._checkReadable() if self._timeout_occurred: raise IOError("cannot read from timed out object") while True: try: return self._sock.recv_into(b) except timeout: self._timeout_occurred = True raise except error as e: n = e.args[0] if n == EINTR: continue if n in _blocking_errnos: return None raise def write(self, b): """Write the given bytes or bytearray object *b* to the socket and return the number of bytes written. This can be less than len(b) if not all data could be written. If the socket is non-blocking and no bytes could be written None is returned. """ self._checkClosed() self._checkWritable() try: return self._sock.send(b) except error as e: # XXX what about EINTR? if e.args[0] in _blocking_errnos: return None raise def readable(self): """True if the SocketIO is open for reading. """ if self.closed: raise ValueError("I/O operation on closed socket.") return self._reading def writable(self): """True if the SocketIO is open for writing. """ if self.closed: raise ValueError("I/O operation on closed socket.") return self._writing def seekable(self): """True if the SocketIO is open for seeking. """ if self.closed: raise ValueError("I/O operation on closed socket.") return super().seekable() def fileno(self): """Return the file descriptor of the underlying socket. """ self._checkClosed() return self._sock.fileno() @property def name(self): if not self.closed: return self.fileno() else: return -1 @property def mode(self): return self._mode def close(self): """Close the SocketIO object. This doesn't close the underlying socket, except if all references to it have disappeared. """ if self.closed: return io.RawIOBase.close(self) self._sock._decref_socketios() self._sock = None