REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 861 B
Close
/opt/hc_python/share/doc/pycurl/examples/opensocketexception.py
Text
Base64
# Exposing rich exception information from callbacks example import pycurl, random, socket class ConnectionRejected(Exception): pass def opensocket(curl, purpose, curl_address): if random.random() < 0.5: curl.exception = ConnectionRejected('Rejecting connection attempt in opensocket callback') return pycurl.SOCKET_BAD family, socktype, protocol, address = curl_address s = socket.socket(family, socktype, protocol) s.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) return s c = pycurl.Curl() c.setopt(c.URL, 'http://pycurl.io') c.exception = None c.setopt(c.OPENSOCKETFUNCTION, lambda purpose, address: opensocket(c, purpose, address)) try: c.perform() except pycurl.error as e: if e.args[0] == pycurl.E_COULDNT_CONNECT and c.exception: print(c.exception) else: print(e)
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 11
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
quickstart
DIR
-
drwxr-xr-x
2025-04-04 08:01:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__pycache__
DIR
-
drwxr-xr-x
2025-04-04 08:01:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
basicfirst.py
545 B
lrw-r--r--
2025-04-04 08:01:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
file_upload.py
1.15 KB
lrw-r--r--
2025-04-04 08:01:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
linksys.py
21.26 KB
lrw-r--r--
2025-04-04 08:01:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
multi-socket_action-select.py
7.81 KB
lrw-r--r--
2025-04-04 08:01:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
opensocketexception.py
861 B
lrw-r--r--
2025-04-04 08:01:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
retriever-multi.py
3.28 KB
lrw-r--r--
2025-04-04 08:01:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
retriever.py
2.60 KB
lrw-r--r--
2025-04-04 08:01:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
sfquery.py
2.40 KB
lrw-r--r--
2025-04-04 08:01:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
smtp.py
1.07 KB
lrw-r--r--
2025-04-04 08:01:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ssh_keyfunction.py
302 B
lrw-r--r--
2025-04-04 08:01:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
xmlrpc_curl.py
2.13 KB
lrw-r--r--
2025-04-04 08:01:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).