unix-socket

Connecting to PostgreSQL on Google Cloud Platform using Unix Sockets and SQLAlchemy

Connecting to PostgreSQL on Google Cloud Platform using Unix Sockets and SQLAlchemy Question: I am trying to connect to a PostgreSQL database hosted on a Google Cloud Platform instance using unix sockets and the SQLAlchemy library. My database instance is configured to accept unix socket connections. When I run my application locally, I use the …

Total answers: 1

Why is os.fchmod not working with a socket file descriptor?

Why is os.fchmod not working with a socket file descriptor? Question: I’m trying to use os.fchmod() as specified in this tutorial. However, when I pass in a file descriptor and a mode, I get back a vague "Invalid Argument" error. import socket import stat import os s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) os.fchmod(s.fileno(), stat.S_IRWXO) How do I …

Total answers: 1

Read and write from Unix socket connection with Python

Read and write from Unix socket connection with Python Question: I’m experimenting with Unix sockets using Python. I want to create a server that creates and binds to a socket, awaits for commands and sends a response. The client would connect to the socket, send one command, print the response and close the connection. This …

Total answers: 3