Questions tagged [unix-socket]

UNIX domain sockets are a technology for interprocess communication on a single computer.

UNIX domain sockets are a technology for interprocess communication on a single computer. They allow processes on the same machine to establish bidirectional connections to exchange either continuous byte streams or datagram messages.

The API is in many places the same as the one used for TCP/IP network sockets. A UNIX domain socket listening for connections may be represented as an inode in the file system, depending on the operating system and the parameters used to bind that socket.

Unix Domain Sockets can only communicate within a Linux OS kernel, they can not communicate externally to a kernel.

Details are provided in the unix(7) man page.

699 questions
0
votes
0 answers

Forward unix domain socket to tcp port

I know socat can forward unix socket to tcp port and it forwards all package. But I just want to send some package, not at all. Is there nodejs (or other languages) source code to forward unix socket to tcp port and it can filter the packages ?
uhnnh
  • 79
  • 10
0
votes
0 answers

How to fix 'Address already in use' returned by bind() in AF_UNIX

I'm familiarising myself with Unix Sockets for Inter-Process Communication, and following a guide here. Each time I run the program that acts as a server (referred to as echos.c in the guide), I am getting an error that says bind: Address already in…
Brendonovich
  • 57
  • 2
  • 4
0
votes
1 answer

Unix networking programming

I have written a client-server program which does some data from a file in server to the client. In this I don't want the client to wait indefinitely if server is not running. For this I am using SELECT system call, in this system call we can…
naresh046
  • 11
  • 1
0
votes
0 answers

What's difference between boost.asio and the packet unp.h in unpv?

As what I've mentioned above, what's difference between them? The latter can be used on unix, as does boost.asio.
LimingFang
  • 131
  • 9
0
votes
1 answer

Connecting to external unix domain socket from NDK JNI

I'm building a POC Android app that needs to communicate with an ELF binary over a Unix domain socket server that the binary binds to and listens on. The app is meant for rooted phones and executes the binary as a superuser upon launch. I need to…
0
votes
1 answer

Django Unit tests fail over domain socket

I have Django configured to use the database with peer authentication over the local Unix Domain socket, instead of user/password authentication. Here's the settings.DATABASES: {'default': {'ENGINE': 'django.db.backends.postgresql', …
0
votes
0 answers

What methods can be used to allow a C program to make stats visible, with no chance of slowing it significantly?

I have a (multi-process) daemon, written in C. I would like it to make its internal counters available to observing processes on the same machine. It is critical that this daemon is never stopped or significantly slower by an observer. If an…
fadedbee
  • 42,671
  • 44
  • 178
  • 308
0
votes
2 answers

UnixStream write/read full string

I have this small example version of a problem that I have: #[test] fn streams() { use std::io::prelude::*; use std::net::Shutdown; use std::os::unix::net::UnixStream; use std::time::Duration; let (mut s1, mut s2) =…
Netwave
  • 40,134
  • 6
  • 50
  • 93
0
votes
1 answer

change socket address mariadb_config

I can't understand what follows, can someone explain me and help me solve the problem? I have a mariadb-server a front-end application in C. I have 2 make files and i'd like that i can use both of them. The first one is this all: gcc -g src/*.c…
fabianod
  • 501
  • 4
  • 17
0
votes
0 answers

Converting from UDP Datagram to UDS datagram

I have a couple of questions regarding Unix Domain Sockets. We currently have an application that has a receiver service receiving datagram packets from multiple client processes on the same machine using the loopback address. We want to convert it…
0
votes
1 answer

How use /var/run/docker.sock inside running docker-compose container?

I have docker-compose.yml like this: version: '3' services: zabbix-agent: image: zabbix/zabbix-agent ports: - "10050:10050" - "10051:10051" volumes: - /var/run/docker.sock:/var/run/docker.sock -…
redflasher
  • 677
  • 9
  • 17
0
votes
1 answer

Maximal length of a UNIX datagram in POSIX

Given a socket(AF_UNIX, SOCK_DGRAM, 0), what is the maximal guaranteed datagram size in bytes that can be sent without receiving EMSGSIZE or any other error number related to invalid message. Another requirement is that this message would be sent…
Daniel Lovasko
  • 471
  • 2
  • 10
0
votes
0 answers

Netcat respond to socket connection

Say I have a netcat server running like so: nc -l 4444 | while read line; do # how can I write back to the socket? done; the only thing I have found so far in my search is to use the -c option to respond: nc -l 4444 -c 'echo "this is the…
user7898461
0
votes
1 answer

How to set up a UNIX domain socket in iOS?

I am trying to set up a UNIX domain socket in iOS. According to https://iphonedevwiki.net/index.php/Unix_sockets, this is the code that I used to set up the socket on the server side: const char *socket_path = "/var/run/myserver.socket"; //…
zfgo
  • 195
  • 11
0
votes
1 answer

Datagram socket server not receiving messages from client

I have a Python server communicating with a C++ client using a unix datagram socket connection. The following code set-ups a socket, and then sends and receives one message from the client. This script works in python 2.7, however, when testing it…
Lokno
  • 590
  • 3
  • 15