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

Get request via socket connect timing out during read

I am trying to write an http client in OCaml: module Connection = struct let sock_fd = let s_fd = Unix.socket Unix.PF_INET Unix.SOCK_STREAM 0 in Unix.setsockopt s_fd Unix.TCP_NODELAY true; s_fd let read_from_sock ()…
eatonphil
  • 13,115
  • 27
  • 76
  • 133
0
votes
1 answer

Mounting a Django project with unix socket

Assuming I will use gunicorn to mount a django application: How can I bind to both localhost:8000 AND to a unix socket? How can I distinguish whether the request (in a view) is coming from the unix socket?
Luis Masuelli
  • 12,079
  • 10
  • 49
  • 87
0
votes
1 answer

Unix domain socket permissions between Ubuntu Lucid and Trusty

I have a web application which I am migrating from Ubuntu Lucid to Trusty. The app communicates w/ Nginx via unix domain sockets (created w/ a umask of 000). On Lucid, I've had no problem with this setup. However, on Trusty, using the same…
David Eyk
  • 12,171
  • 11
  • 63
  • 103
0
votes
1 answer

Read data directly from /dev/log Unix Domain Socket

My project aims at reading log messages directly from /dev/log UNIX domain socket in Java. Currently I am using junixsocket. Below is a sample code of client that reads from a unix socket. import java.io.File; import java.io.IOException; import…
Ankit
  • 1,240
  • 2
  • 13
  • 16
0
votes
1 answer

set socket buffer size for receive and send buffer

How can I set the socket buffer size for a UNIX socket file descriptor in C? I understand setsockopt is probably the system call involved... Can anyone give an example of how to use it, the one's I have found do not explain how to set the buffer…
tsar2512
  • 2,826
  • 3
  • 33
  • 61
0
votes
1 answer

Subsystem on sshd_config

In /etc/sshd/sshd_config , I could see Subsystem sftp /usr/libexec/openssh/sftp-server This specifies the subsystem and its location. How and when will the subsystem be started? Thanks Venkat
venkat
  • 1
  • 3
0
votes
1 answer

Just get one last value from socket

I send data to socket on one side every second, but I can read that data on another side in any moment. Here's the writer: from settings import Config filename = Config.NAVIGATION_SOCKET_FILE client = socket.socket(socket.AF_UNIX,…
Dmitrii Mikhailov
  • 5,053
  • 7
  • 43
  • 69
0
votes
1 answer

Interconnection between two processes

I have two processes and I need to send messages between them. Here's the first file: import socket from info import socket1_filename, socket2_filename socket1 = socket.socket(socket.AF_UNIX,…
Dmitrii Mikhailov
  • 5,053
  • 7
  • 43
  • 69
0
votes
1 answer

back-and-forth unix domain sockets lock

I am writing two programs one in c++ and the other in Python to communicate with each other using unix domain sockets. What I am trying to do is have c++ code send a number to the python code, which in turn send another number back to c++. This goes…
0
votes
1 answer

Mono NginX and FastCGI over unix socket

Does anyone have any tips for setting up communication between NginX and Mono's Fast CGI server over a unix socket? I have tried starting the server like this: fastcgi-mono-server4 /appconfigdir=/etc/init.d/mono-fastcgi /socket=unix:/tmp/site.socket…
booler
  • 705
  • 1
  • 7
  • 15
0
votes
1 answer

Can unix sockets be accessed without using __sock_recvmsg?

I'm trying to debug an interaction between a driver and a user program that talks to each other using a unix socket. So my question is: "Is the method __sock_recvmsg (in net/socket.c) the only way data is received from a socket or are there other…
0
votes
0 answers

How to set Socket Timeouts in ruby's UNIXSocket?

I want to set the SO_SNDTIMEO on a Ruby Socket. The unix socket class does not seem to allow that? How does one do this.
sheki
  • 8,991
  • 13
  • 50
  • 69
0
votes
0 answers

Connect LocalSocket to some port

I have 2 android applications: 1. NDK C socket server which uses UNIX domain sockets (works fine). It binded to some port. 2. Java client which communicates with the server. As I understand I should use LocalSocket class like in for…
Costa Mirkin
  • 947
  • 3
  • 15
  • 39
0
votes
1 answer

unix domain socket programming

I have a unix domain socket program, the client try to connect to the server and send a message, when the server accept the client and read the message,it will sleep for 5 seconds and send another message.During the 5 seconds if I use ctrl+c to kill…
bigpotato
  • 211
  • 2
  • 3
  • 13
0
votes
1 answer

0403-057 Syntax error: `;' is not expected

if [ -d patch/tempatch ]; then; cd patch/tempatch/; for i in `ls`; do; tar -xvf $i; rm -f $i; done; for i in `ls`; do; cd $i; cp -R files/* patch/SP02JUL11/files/; cd ..; rm -Rf $i; done; else; echo "directory not found"; fi All the commands in…
user3468019
  • 3
  • 1
  • 1
  • 2