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

Pass POST data to unix domain socket through nginx

I have a unix domain socket file and it is working with with nc command. Now I want to access it via nginx but it does not work. Am I missing something? test with nc => it works $ echo '{ "method" : "getinfo", "params" : [], "id" : "1" }' | nc -U…
zono
  • 8,366
  • 21
  • 75
  • 113
0
votes
1 answer

send() on a UDS socket returns without sending the entire data. Why?

I am working on an embedded device running Linux. In my application, a server thread opens a UDS socket and waits for connections. When a client (a different application/process) connects, it processes the request and sends the requested data. The…
0
votes
1 answer

EPROTOTYPE error whilst attempting to connect node.js unix socket client to C program

I'm rewriting a PHP application in Node.js. A C program runs on the Linux OS that also hosts PHP. In short, the C program handles sending data from the PHP web interface to some proprietary hardware. It also handles the creation of the socket file,…
wntwrk
  • 317
  • 1
  • 2
  • 10
0
votes
1 answer

Sending data over unix domain socket for UV4L data-channel

I have a question related to sending binary data from a Raspberry Pi to web client over WebRTC data channel. I have actually found a solution, but I believe it may be inefficient, and I'm not sure exactly why it works. Basically, I have a UV4L…
Roni Peled
  • 38
  • 4
0
votes
1 answer

What are the reasons socket creation can fail?

I am creating a socket with the parameters as below- fd = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP); But for some reason socket creation is failing and fd is set to -1. I wanted to understand for what and all reason can socket creation get…
Darshan L
  • 824
  • 8
  • 30
0
votes
0 answers

why data is received not the same way it has been sent over UDS?

I am investigating a bit UDS for logging from an app and then using another process to send the logs to an external server. Overall it seems to work fine but when I was testing it I discovered that if I send some logs in a for loop, when stream is…
Mattia Procopio
  • 631
  • 8
  • 16
0
votes
1 answer

Working With Unix Domain Sockets In Python - How to possibly loop through lines coming from socket and perform actions on those lines?

Essentially I started using sockets because of how fast and efficient they are. Basically I have a program in python that parses the lines coming from the sockets but this program works on a .txt file. I'm trying to figure out a way to incorporate…
Tanner A
  • 11
  • 4
0
votes
1 answer

Asio async handler is never called, no other handler invoked

I have a asio sync connection. ioService is in one thread (I have only one thread.). Smaller problem: boost::asio::async_write(m_socket, boost::asio::buffer(requestStr.data(), requestStr.size()), handler); The handler is never called, but the…
Depp
  • 35
  • 7
0
votes
1 answer

Can unix socket be used for thrift ruby client?

I'm trying to use thrift, and use ruby as client side. I'm trying to find documentation for how to initialize a ruby client using the unix domain socket. Is it possible to use thrift on ruby client and use unix domain socket?
Yuki Inoue
  • 3,569
  • 5
  • 34
  • 53
0
votes
1 answer

C++ Socket Pair Not Reading/Writing Parent/Child

I've been assigned a project in which I need to use Unix Domain Sockets to communicate two-way between a parent and child process. My original approach was to create a child and server, but I was getting some serious issues with connectivity and…
Ainsley
  • 33
  • 9
0
votes
1 answer

Invalid Argument from sendto() Socket Program in C

I'm trying to make a simple client-server API to be used for two of my machines. I made this simple program that uses the functions I made to test it. For some reason my client sends a message just fine, but my server can't (however, it receives the…
AsiaRican
  • 75
  • 1
  • 13
0
votes
3 answers

Connected Unix SOCK_DGRAM sockets

I've followed the code in this answer to create a pair of programs which send and receive datagrams via a Unix socket. What's awkward about this: On the side which creates the first socket (i.e. the "server"), I can't use calls to send, recv, read…
arrtchiu
  • 1,076
  • 1
  • 10
  • 23
0
votes
1 answer

POSIX select Never Returns Positive

select never returns when calling it with a UNIX Domain Socket server after a client connects. My code, without error checking and safety for clarity: Server: int socketServer = socket(AF_UNIX, SOCK_STREAM, 0); struct sockaddr_un…
gudenau
  • 500
  • 5
  • 19
0
votes
1 answer

Thrift communication between .NET Core and C using linux domain sockets

I'm trying to create a message pipeline over Linux domain sockets between a .NET Core and pure C application and decided to use Apache thrift for that. The problem is that using their .NET Core library I can't seem to be able to find out how to…
Petrroll
  • 741
  • 7
  • 29
0
votes
1 answer

How to keep persistent SQL Proxy Unix Socket with Google Compute Engine

I have a GCE instance that uses older mysql connection type and in order to connect to a Google Cloud SQL instance, I open an SSH connection through the browser on the GCE instance and run the following: > cd / > ./cloud_sql_proxy -dir=/cloudsql…