unix-socket

Executing child process in new terminal

痴心易碎 提交于 2019-12-24 11:41:17
问题 I want to make a simple chat application for unix. I have created one server which supports multiple clients. When ever a new client connects to the server a new process is created using fork command. Now the problem is all the child processes share the same stdin on the server, cause of this in order to send a message to 2nd clien 1st child prosess has to terminte. In order to resolve this I would like to run each child process in a new terminal. This can be achieved by writing the code for

Cannot connect to native local socket on android 5.1

你离开我真会死。 提交于 2019-12-23 16:13:16
问题 I have commad-line tool, which sends broadcast and wait result. Server code (error handling omitted): int makeAddr(const char* name, struct sockaddr_un* pAddr, socklen_t* pSockLen) { int nameLen = strlen(name); pAddr->sun_path[0] = '\0'; strcpy(pAddr->sun_path+1, name); pAddr->sun_family = AF_LOCAL; *pSockLen = 1 + nameLen + offsetof(struct sockaddr_un, sun_path); return 0; } int main(int argc, char* argv[]) { //... // Create socket in abstract namespace struct sockaddr_un sockAddr = {0};

a LocalSocket (Unix domain) client-server data flow issue for MediaRecorder in Android (Java)

岁酱吖の 提交于 2019-12-23 01:21:13
问题 What I don't get is data flow among the Unix Domain Sockets . I understand Unix Domain Socket data flow is LocalSocket client .connect() --> LocalServerSocket server .accept() The client sends data to the server, straight enough that I understand. However, for Streaming video/audio from MediaRecorder of Android, after a lot of research, I've seen every example to use a LocalSocket instead of a file for MediaRecorder is in principle as below: https://static.foxdogstudios.com/static

Node.js: Send GET request via unix socket

霸气de小男生 提交于 2019-12-22 05:04:44
问题 I am new to the node.js . I am trying to setup the client server connection using unix socket, where my client request would be in node.js and server running in the background would be in go. Client side Code: var request = require('request'); request('http://unix:/tmp/static0.sock:/volumes/list', function (error, response, body) { if (!error && response.statusCode == 200) { console.log(body) } else { console.log("In else part of the receiver" + response.statusCode + body) } } }) When I try

How to reliably unlink() a Unix domain socket in Go programming language

被刻印的时光 ゝ 提交于 2019-12-22 03:48:51
问题 I have a Go program hosting a simple HTTP service on localhost:8080 so I can connect my public nginx host to it via the proxy_pass directive, as a reverse proxy to serve part of my site's requests. This is all working great, no problems there. I want to convert the Go program to host the HTTP service on a Unix domain socket instead of a local TCP socket for improved security and to reduce the unnecessary protocol overhead of TCP. PROBLEM : The problem is that Unix domain sockets cannot be

What are the differences from running PHP-FPM over an Unix Socket vs a TCP/IP Socket?

十年热恋 提交于 2019-12-21 03:25:44
问题 There are these two ways of running PHP-FPM. I know that nothing is bullet-proof in tech, but what are the pros and cons from both methods? 回答1: The difference is mainly the added overhead of using the full network stack to "pack" and "unpack" every piece of data. Mind you that the overhead is negligible for most deployments Using a socket (e.g. listen = '/tmp/php-fpm.sock') makes sense when both the front-end (e.g. Nginx) and php-fpm are in the same box and You have the option to scale

HTTP over AF_UNIX: HTTP connection to unix socket

时光总嘲笑我的痴心妄想 提交于 2019-12-21 03:20:09
问题 We have HTTP server , for which we have HTTP client based application (on Linux) working fine. But now we need to listen on Unix domain sockets from our client application. So is it possible to send/receive httprequest, httpresponse packet from the unix domain socket? Scenerio1:When connecting to localhost, it is required to eliminate the SSL overhead by connecting HTTP to the unix socket instead of HTTPS to the local port. Basically Looking for a standard encoding a unix socket path in an

PHP Artisan Migrate with MAMP and Unix Socket

依然范特西╮ 提交于 2019-12-20 09:45:02
问题 I was developing my application originally in Laravel 4.2 but have since decided to move it to the 5.0 version so that it covers a lot more changes and strengths that 5.0 has over 4.2. I am trying to run my migratiosn however I am getting the error: [PDOException] SQLSTATE[HY000] [2002] No such file or directory I looked into this and noticed how it is because I'm running MAMP for my server instead of vagrant and homestead. I'm not knocking the uses of those two but I at this point feel more

UNIX socket implementation for Java?

ぃ、小莉子 提交于 2019-12-17 04:57:10
问题 I realize that since UNIX sockets are platform-specific, there has to be some non-Java code involved. Specifically, we're interested in using JDBC to connect to a MySQL instance which only has UNIX domain sockets enabled. It doesn't look like this is supported, but from what I've read it should be at least possible to write a SocketFactory for JDBC based on UNIX sockets if we can find a decent implementation of UNIX sockets for Java. Has anyone tried this? Does anyone know of such an

Can I pass a file descriptor over a 0mq (zeromq) ipc socket?

帅比萌擦擦* 提交于 2019-12-13 15:38:22
问题 I have a master process and several workers, communicating using 0mq 'ipc://' sockets (UNIX domain sockets). I want to pass a file descriptor from the master to a worker, along with a message. I know that 'raw' UNIX domain sockets can be used to pass a file descriptor from one process to another, but can I do it with my zeromq sockets? I don't care about portability, and frankly I don't care if its a slightly dirty solution. Is there any way? Thanks in advance. 回答1: Hackiest method would be