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
1 answer

NodeJS net.Socket: `connect` vs `ready` event

I had hard time debugging a problem with my NodeJS' code today. I have problems when I open two connections to the same unix socket (reasons though); and for unknown reasons, sometimes it works fine throughout; and sometimes I don't get back any…
Ardeshir Izadi
  • 955
  • 1
  • 7
  • 25
0
votes
1 answer

Docker.dotnet ListImages fails with permission denied on /var/run/docker.sock in Redhat

Disclaimer: I aware the /var/run/docker.sock issue is way common and there are lots of posts out there on it (although most if not all can be summed up to adding the running user to the docker permissions group). I tried all the those instructions…
Veverke
  • 9,208
  • 4
  • 51
  • 95
0
votes
2 answers

Mysql ([Errno 111] Connection refused)")

I want to connect python with MySQL. On my local computer i get it like this: connection = pymysql.connect(host='127.0.0.1', user='test', password='password', …
Sss
  • 15
  • 2
  • 7
0
votes
1 answer

How to show reliability of Unix datagram socket

This a homework question relating to Unix socket and I tried to google to get the solution but I found nothing. The question comes from the Linux programming interface ebook, 57.1 we noted that UNIX domain datagram sockets are reliable.…
dustin2022
  • 182
  • 2
  • 18
0
votes
1 answer

Mariadb unix_socket (without password) or mysql_native_password what is safer?

I have informed myself and apparently there should be a connection from zb. to create a PHP script via the unix_soket (no password is needed and the connection only works via localhost) since no TCP connection is established and therefore no…
0
votes
2 answers

Unix socket gets stuck at accept()

I am writing a server that should wait for client to connect. After accessing the main loop server should "bounce" so long accept() does return a different value then -1. The problem is that the accept() method is blocking the execution instead of…
0
votes
1 answer

How do I assign an u_int32_t IPv4 address to the address parameter of sockaddr_in in C? (Socket Programming in C)

I've managed to get the broadcast address as a u_int32_t, and my goal is to assign the broadcast address to the saddr.sin_addr.s_addr parameter so I can turn it into a string with inet_ntoa(): struct sockaddr_in *broadcastInfo; char…
user14715834
0
votes
1 answer

Why Connection refused got when connecting to LocalServerSocket from native program in Android

There is a java server LocalServerSocket listening on an abstract unix domain socket which named 'myaudsocket', like as: public void listen() { String name = "myaudsocket"; mSocket = new LocalServerSocket(name); LocalSocket client =…
progquester
  • 1,228
  • 14
  • 23
0
votes
1 answer

What is better practice, create one unix socket with multiple connections or multiple sockets with one connection?

I'm making the design of a program that is going to create multiple process with exec and then create a connection to them using sockets and I have multiple alternatives but I don't know which one is better. Every child process is going to have…
Fransebas
  • 321
  • 4
  • 10
0
votes
1 answer

Unix domain socket and write buffer overflow

I use Unix domain sockets in one of my application and I am observing a very strange behavior while writing to a socket. A short description: there are 2 application - client and server where each one read and write at the same simultaneously, i.e.…
folibis
  • 12,048
  • 6
  • 54
  • 97
0
votes
1 answer

Is there a function for determining how many bytes are left to read on a unix domain socket?

The aim is interact with an OpenEthereum server using json-rpc. The problem is once connected, I need to react only when receving data as the aim is to subscribe to an event so I need the recv() function to be blocking. But in that case, if I ask to…
user2284570
  • 2,891
  • 3
  • 26
  • 74
0
votes
1 answer

How to exit the process in B program process, if input is -1 using signal in C

I would execute both process in A program and process in B program. first of all, A program is executed. and then, B program is executed. A program and B program are sharing one data file. A => input from user and then write a number to data file. B…
Richard Lee
  • 203
  • 1
  • 2
  • 9
0
votes
2 answers

SIGIO vs epoll for Linux sockets

The socket documentation for linux (man 7 socket) says that you can set your socket to be O_ASYNC and then receive a signal when the socket is ready for read/write. However, it seems most people use epoll instead. What is the reason for using epoll…
CaptainCodeman
  • 1,951
  • 2
  • 20
  • 33
0
votes
0 answers

nftables blocking local unix sockets

I can't seem to find any documentation that explains how to configure nftables to allow unix sockets for passthrough. I've got a CentOS 8 box running an LDAP server, and local commands like ldapsearch/ldapwhoami fail unless I disable nftables or…
M4v
  • 63
  • 6
0
votes
1 answer

Send and Receive File Descriptors through LIBUV Pipe

I have to send file descriptors of some shared memory buffers from one process to another. I'm able to transfer the fds directly over UNIX Domain Sockets as below: Send FDs: static void send_fds(int socket, int* fds, int n) // send fd by socket { …
manish reddy
  • 157
  • 1
  • 11