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

UNIX domain socket server and client not communicating bi-directionally

I wrote a C++ server and a PHP client both communicating based on UNIX domain sockets. Reading OR writing in either direction works just fine. As soon as I try to read AND then write (or vice versa), the communication does not finish: the client…
Sceptical Jule
  • 889
  • 1
  • 8
  • 26
0
votes
1 answer

Can javascript socket io listen unix sock?

Expected behavior Server : unix://IP_ADDRESS/path/to/setup.sock Client : javascript (cannot using node.js only can use socket.io or web socket) Communicate server <-> client Actual behavior Web socket cannot listen unix:// I dont know how to…
stories2
  • 466
  • 1
  • 5
  • 20
0
votes
1 answer

502 - Bad Gateway / "connection refused while connecting to upstream" through a fully unrestricted unix socket

TL;DR : I have an application consisting in a nginx container linked to a php container and I get a connection refused (502 - Bad Gateway in the browser) if I try to reach my app while using a fully unrestricted (0777 mode) unix socket that both…
vmonteco
  • 14,136
  • 15
  • 55
  • 86
0
votes
0 answers

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

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…
Tey'
  • 961
  • 12
  • 23
0
votes
1 answer

How can I configure thin from .yml to use tcp sockets?

I have here a RoR app, what I am using with the thin appserver. Its configuration is in an .yml file, so: --- pid: /srv/cica/tmp/pids/thin.pid group: cica wait: 30 timeout: 30 log: /srv/cica/log/thin.log max_conns: 1024 require: [] environment:…
peterh
  • 11,875
  • 18
  • 85
  • 108
0
votes
1 answer

kernel_recvmsg gets wrong data sometimes

I have a module that receives data in two parts. First an unsigned integer indicating the length of data that will be followed next. Then the data itself. I do this as follows in an infinite loop unsigned int z; struct kvec vec; struct msghdr…
0
votes
1 answer

Channels in Golang with TCP/IP socket not working

I just started writting a Golang client for a server that I've made in C with TCP/IP sockets, then I figured out that my channel wasn't working. Any ideas why ? func reader(r io.Reader, channel chan<- []byte) { buf := make([]byte, 2048) for { …
Boris Le Méec
  • 2,383
  • 1
  • 16
  • 31
0
votes
1 answer

Completely in-memory FILE *

I'm writing some code to perform an integration test of some C code that reads a TCP socket. The code is written in such a way that I can easily pass it any FILE * so my initial thoughts for testing the code was to use UNIX sockets instead to fake…
Huckle
  • 1,810
  • 3
  • 26
  • 40
0
votes
1 answer

In UNIX find and list file_names consisting number and date, if greater than a specific number

I have many files in unix system that match the pattern 'ZLOG_106475_20170517.zip' where, 106475 denotes the id within the filename. I want to fetch the names of all such files having id greater than a specific no e.g. 106171 And push the…
sailesh
  • 93
  • 1
  • 1
  • 5
0
votes
1 answer

Server program not ending when "quit" string entered

I've got a basic linux socket program mostly running that accepts strings from the client to send to the server. When "quit" is typed, my client program ends, but the server one prints out "quit" endlessly until you kill the program. Either I'm not…
user7520896
0
votes
2 answers

Sending larg JSON data via UDS

I'm trying to send long json strings from one process to another via a UDS socket and the UDP protocol, like so: # server.py def main(): if os.path.exists(UDSFILE): os.remove(UDSFILE) sock = socket(AF_UNIX, SOCK_DGRAM) …
deepbrook
  • 2,523
  • 4
  • 28
  • 49
0
votes
2 answers

kill socket.accept() call on closed unix socket

Socket.close() does not stop any blocking socket.accept() calls that are already running on that socket. I have several threads in my python program that only run a blocking socket.accept() call on a unix domain socket that has been closed…
Troido
  • 78
  • 6
0
votes
1 answer

Unable to get individual data callbacks with net.createConnection();

I am a newbie to Node.js concepts. I am studying the use of Unix sockets as a means of communication between C and Node.js. In C: I am sending 1000 iterations of a 100 byte long message. In Node.js: I am receiving 4 data callbacks of size: 1st…
Ramdas
  • 3
  • 2
0
votes
0 answers

Jetty process logged too many open files warning due which log file size increased up to 377 GB

Jetty(v9.2.12) process logged too many open files warning due which log file size increased up to 377 GB and Jetty process was down. 2017-04-21…
h.p.kumar
  • 1
  • 2
0
votes
2 answers

Bind error in local socket

I have to write some code which does the following: client reads input from keyboard and sends the string to the server. Server prints client's IP and the string. Compile time is fine, but when I run the code there's bind error "no such file or…
rafc
  • 78
  • 11