unix-socket

Access protected UNIX domain sockets from Android app (using root)

冷暖自知 提交于 2020-01-17 07:55:28
问题 I need to access a UNIX domain socket from my Android app. Its file is located in /dev , so I need root permissions to open it. My phone is rooted, so gaining this permissions is not a problem. However, I failed to find a way to access this socket from root and forward the communication to my app. AFAIK, the only way Android apps can get root permissions is through the su tool, so I need to find a native tool (already installed in the phone) that can make a bridge between STDIN/STDOUT and

Node.js Express sessions using connect-redis with Unix Domain Sockets

余生颓废 提交于 2020-01-16 19:27:49
问题 I am trying to utilize a Redis-based session store using connect-redis , communicating over UNIX Domain Sockets. There is this: Redis Connection via socket on Node.js but the answer is specific to node-redis , and not the connect-redis for Redis session stores. I thought it would be easy to get things going by creating my own node-redis object using and passing in a 'client' parameter, as described in the 'Options' section of the README here: https://github.com/visionmedia/connect-redis But,

How to create a Unix-domain socket with specific access permissions

佐手、 提交于 2020-01-15 07:53:40
问题 I have a situation in which I intend to communicate with a service through a command interface made available via a UNIX-domain socket on the file system. I am able to successfully send it commands, but for a while sat perplexed as to why I could not receive any response to my queries. As it turns out, the service did not have sufficient permissions to write to the address I (or the OS) provided for it. However, I realized that if I explicitly bind to an address on the file system then I

Raise TimeOutError after given time for multiprocessing.connection.Listener.accept()

倖福魔咒の 提交于 2020-01-13 18:27:35
问题 I'm trying to interrupt multiprocessing.connection.Listener.accept() , but have thus far been unsuccessful. Since it doesn't provide a timeout parameter, I thought perhaps I could use socket.setdefaulttimeout() to interrupt it, as suggested in post I cannot find anymore, here on SO. This didnt work. I then tried calling close() on the Listener() object. according to this post's answer, this should have worked. It appears, however, that these objects to not play along with the usual socket

Linux/Unix Socket Self-connection

流过昼夜 提交于 2020-01-12 10:35:28
问题 When a client try to connect to a server, if client and server are both localhost, self-connection may happen(source port and destination port happened to be the same.). But my problem is, client is not listening to that port, how can self-connection be possible? 回答1: I found your question after encountering the same phenomenon. The best explanation I found is at Everything About Nothing: TCP Client Self Connect. You can ask for the port assigned to you via getsockname() and compare it to the

Unix socket error postgresql 9.4

馋奶兔 提交于 2020-01-03 04:42:06
问题 I just installed postgresql 9.4 on a brand new 15.04 ubuntu install and I'm unable to start the psql server. Every time I try to run sudo -u postgres psql, it gives me the following error: psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? I have tried every single solution posted here and on every other forum, but none have worked except one: http://ubuntuforums.org

Nginx is giving uWSGI very old requests?

孤街醉人 提交于 2020-01-01 07:05:26
问题 I'm seeing a weird situation where either Nginx or uwsgi seems to be building up a long queue of incoming requests, and attempting to process them long after the client connection timed out. I'd like to understand and stop that behavior. Here's more info: My Setup My server uses Nginx to pass HTTPS POST requests to uWSGI and Flask via a Unix file socket. I have basically the default configurations on everything. I have a Python client sending 3 requests per second to that server. The Problem

Unix Domain : connect() : No such file or directory

孤人 提交于 2019-12-30 08:22:38
问题 as stated in the title, my connect() call to an unix domain type socket with an according address results in the error ENOENT: no such file or directory . The two sockets are properly initialized and the socket files are created and bound accordingly. The server and client sockets run in a different process, though the client process is fork()-ed and execl()-ed. This is also how I parse the address for the client and server socket, which I use for setting up the client socket. The server

Socket Programming: UDP Client-Server in C

☆樱花仙子☆ 提交于 2019-12-30 02:18:13
问题 I'm trying to write a client server program using UDP, and wait-and-stop, but I haven't got to that part, I'm still trying to figure it out how the two processes (server and client) communicate, because on my client program, the user needs to enter the server name or IP address, and a port name, and then send an expression that the server should calculate. However, I dug some tutorials in the internet and after coding accordingly (or I thought so) I can't make the client communicate with the

UNIX Domain Socket in Java

核能气质少年 提交于 2019-12-30 01:53:23
问题 I see these threads UNIX socket implementation for Java? and http://forums.sun.com/thread.jspa?threadID=713266. The second link says that Java already supports UNIX Domain Socket. If that's true what class do I need to implement from Java?. From the first link, it says that Java does not support UNIX Domain Socket. If you need UNIX Domain Socket you must use a 3rd-party library. So, which is it? 回答1: Java cannot create or access Unix Domain Sockets without using a 3rd party (native) library.