Questions tagged [socket]

is a data communications endpoint for exchanging data between processes executing within the same host operating system.

Filter by
Sorted by
Tagged with
0 votes
1 answer
21 views

Too fast checking local ports with python socket

This code example is given in the book "CPython Internals". from queue import Queue import socket import time timeout = 1.0 def check_port(host: str, port: int, results: Queue): sock = ...
1 vote
1 answer
34 views

Assign capability to systemd service and specific user

I am working on an embedded system device which basically has root user. I have a systemd service call.service which works fine with root access. The service basically creates a few sockets and then ...
0 votes
2 answers
380 views

Programmatically ascertain aspects of socket file

I'm trying to write a program (in C) which, as one of its features, walks the procfs to find open sockets and ascertain things like the destination/source ports/addresses (similar to what netstat and ...
4 votes
2 answers
7k views

why do I find (under /proc/pid//fd) sockets with broken symlinks

I don't think they're closed, because I would expect that after a close() the fd would disappear, but I see a bunch of lingering fd -> socket[xxxxx] entries with broken symlinks which don't seem to be ...
0 votes
0 answers
37 views

Gunicorn doesn't create MyProject.sock file

I'm not a Unix expert and I'm having a problem with a WebApp running on Azure on an Ubuntu server (20.04.5 LTS), gunicorn.service doesn't create the MyProjet.sock file. Specific, the WebApp has always ...
1 vote
1 answer
465 views

Openssl output to socket

I want to extract the signer from an S/MIME file inside a node app. I use (child_process.spawn(), which runs this command openssl smime -verify -CAfile c_root.pem -inform DER -signer /proc/self/fd/1 ...
0 votes
1 answer
61 views

compile error with tiny http server c code gcc debian

My distro is MX Linux (Debian) GCC was already installed with distro. I am trying to compile some open source code from Nir Lictman. His Minimalist C web server code compiles in his YouTube video. ...
0 votes
1 answer
46 views

Check if a socket file can be used

I use the contromaster option with my SSH command, like so: ssh -i id_rsa -o ControlMaster=auto -o ControlPath='~/.ssh/controlmasters/%r@%h' -o ControlPersist=3600 user@hostname This allows me to ...
0 votes
2 answers
2k views

Mariadb on Raspbian: Can't connect to local MySQL server through socket

I'm setting up a "clean" image for my home Raspberry pi running the latest Raspbian, and I'm finding a small problem when installing the mariadb database. So far, the steps I've taken are ...
0 votes
0 answers
86 views

Is possible to "sniff" a socket? Socat doesn't work

This is the situation: I have two VM (virtual machines) via kvm-qemu connected via virtual-serial (a socket). I created the two vm's with this serial configuration: serial1 (slackware, uses port1 ...
5 votes
1 answer
2k views

Is there a way to simulate a socket stuck in CLOSE_WAIT or FIN_WAIT2?

I have a problem that I am trying to hack around where I have lots of local port forwards getting sockets stuck in CLOSE_WAIT and lots of remote port forwards getting sockets stuck in FIN_WAIT2. ...
0 votes
0 answers
33 views

DHCP server can not receive my client in virtual interface

I'm writing a DHCP server and my own client using socket in Python3. My client: def client(self): print("DHCP client is starting...\n") dest = ('<broadcast>', ...
2 votes
2 answers
2k views

How to create a socket forwarder as a server?

I'm looking for a tool that starts a socket server, and forwards incoming requests on that socket port to another internal one. I found socat is able to forward socket ports in general: socat tcp-l:...
10 votes
2 answers
11k views

Write inside a socket open by another process in Linux

Is it possible on Linux for a process to write inside a socket open by another one? Let's say I open a connection to google.com using netcat: myuser@linux:~$ nc google.com 80 Now I can lookup for ...
14 votes
1 answer
2k views

Sharing unix sockets across unprivileged lxcontainers

I have two unprivileged containers and I'd like to share a unix socket between them. Each container has its own user on the host, complete with separate subuid and subguid mappings. I've tried ...
0 votes
1 answer
78 views

How do I find out reason of missing packets in response to `sendto` syscall?

strace ... -e sendto shows a successful (i.e. positive return value) outcome of trying to send a UDP datagram somewhere, but tcpdump -i any in that network namespace does not show anything relevant in ...
4 votes
4 answers
1k views

Ist it possible to check the peer address before accepting a TCP connection?

I wrote a simple Perl server that listens on a TCP port/socket, accepting connections. Now I wonder: When wanting to implement address-based access control, is it possible to check the address of the ...
0 votes
1 answer
128 views

select() marks a FD to be readable, but there is no data to be read

I'm encountering an issue in my server code where calling accept() on the listening socket will occasionally block, even though select() marked it readable. My understanding is that this isn't a case ...
0 votes
0 answers
21 views

SocketCAN how can I get result of the operation

Is it possible to get the status of the CAN operation? Example operation: write(socket, &frame, sizeof(frame)); Is it possible to check if the frame was ACK-ed or get any other CAN status ...
0 votes
0 answers
40 views

Ad-hoc Wi-Fi: disable wireless comms while keeping interface up

TLDR: I want to prevent wireless communication with peers on a Raspberry Pi ad-hoc WiFi network but without bringing it down or disabling the interface. This is to simulate the nodes getting out of ...
7 votes
4 answers
5k views

How do I make systemd sockets close when service is stopped?

I'm currently trying to make a systemd service with two Fifo sockets. These sockets map to stdout and stdin of the application. I'm currently using the following configuration files. foo.service [...
0 votes
1 answer
379 views

Does Wayland/Xwayland have a legacy x11 display socket?

I am trying to pass an x11 socket to a docker container as a volume so that it's applications can display on my screen. I am unsure of how to do this seeing as I am on wayland and I, a. do not know ...
0 votes
0 answers
13 views

SHIBD Daemon not creating Socl file

The SHIBD daemon is failing to start with the error message "no such file or directory". It appears that the daemon is not writing the file. Any ideas are helpful.
1 vote
1 answer
146 views

After enabling ETF qdisc packets are only sent for a few seconds

I have two computers that are connected via an Ethernet cable with Ubuntu 22.04 installed on them. I have a client on computer A) which is sending UDP packets to a server on computer B). I am ...
0 votes
1 answer
391 views

How to Make a Systemd Private Network Namespace Accessable

So I have an application that only binds to 0.0.0.0 and listens on a port (TCP). The communication is unencrypted and unauthorized so I'd like to work around that without getting too deep into the ...
1 vote
2 answers
148 views

Docker on Linux (Manjaro), after system update change location of socket from /var/run/docker.sock to /run/docker.soc - docker doesn't work

After I made regular update of system and apllication, docker (and docker-compose plugin) doesn't work: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker....
2 votes
0 answers
34 views

How to cancel a packet scheduled for time-based transmission after it's enqueued?

I have a time-sensitive networking application I am writing that involves receiving individual Ethernet frames, and then sending the data onward in another Ethernet frame after a precise 1 second ...
0 votes
0 answers
17 views

Disparity between file-nr and netstat

> netstat | grep :389 | grep ESTABLISHED | wc -l 2116 > cat /proc/sys/fs/file-nr 1920 0 3178047 how can a subset of the number of tcp connections be more than the total number of file ...
0 votes
1 answer
49 views

Cannot restart tmux session - Cannot unlink tmux socket file [duplicate]

I am using tmux to create a shared session in /tmp called tekkit. All works fine, with one major exception. When the tmux session is closed, the /tmp/tekkit socket file remains in place. This is a big ...
0 votes
1 answer
46 views

Why does netstat show my socket tutorial program having a port of "x11-1" instead of the port I set in code?

I am trying to learn about socket programming, and I have the following function to set up a socket: 29 int CreatePassiveSock(char *protocol, char *portstr, int qlen) { 30 ...
0 votes
1 answer
308 views

conditional flush tcp sockets on linux

whenever I write data to a tcp socket, it waits until its filled with enough data ex: 64k (max packet size) then it sends data to the wire. this misses the data at the right time for the other end. ...
0 votes
1 answer
508 views

Application server socket won't open in docker on my machine

Introduction I am developing a proprietary application that uses libevent with libevhtp to create a server socket for http communication. I wrote a Dockerfile to place this application in a docker ...
0 votes
0 answers
23 views

Linux socket modes of IO

There are three modes of i/o. They are Programmed IO, Interrupt IO and DMA. My understanding is, Programmed IO requires CPU to busy-wait while Interrupt IO by nature, is ansynchronous. Where can I ...
0 votes
0 answers
142 views

Is it possible to make Linux use Unix Domain Socket automatically on local socket

My team is developing a micro-service web backend. The developers know nothing about deployment, they just deploy the service with some web framework, such as Springboot. The deployment is controlled ...
1 vote
1 answer
1k views

strace for troubleshooting inter process communication

I have output captured by following command: strace -f -e trace=process,socketpair,open,close,dup,dup2,read,write -o rsync.log rsync -avcz --progress src/ dst/ it is a bit long so I've uploaded it ...
35 votes
2 answers
37k views

Understanding output of lscpu

You can see the output from lscpu command - jack@042:~$ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 56 On-...
0 votes
0 answers
102 views

What is the right usage of SIOCGIWSCAN to scan WIFI AP?

I am working on an embedded Linux system (kernel 5.10.24), there is a WLAN interface in the system. Now I want to scan the nearby AP, I think I can use socket and SIOCGIWSCAN command to get the AP ...
0 votes
0 answers
14 views

sockstat of php-fpm doesn't match config file

I am trying to get a test system up and running under FreeBSD (actually under a TrueNAS jail) using nginx, php and php-fpm. This is the first time I've tried to build such a system, and FreeBSD isn't ...
0 votes
0 answers
82 views

How to allocate socket buffer memory from local memory of specific NUMA node

My computer has 2 CPUs, and each node has its local memory. They operate using NUMA architecture. The operating system (O/S) is Rocky Linux 9.1 (x86_64). Additionally, each CPU is equipped with a ...
2 votes
0 answers
60 views

SOCKET auditd hex value meaning

I have the following log messages from auditd. They appear to log calls to socket. type=SYSCALL msg=audit(05/11/2023 23:19:52.913:2533) : arch=x86_64 syscall=socket success=yes exit=9 a0=inet a1=...
4 votes
1 answer
4k views

What is the difference between /etc/group and /etc/subgid?

I am in a Docker context and i am using user namespaces to map my container's user into my host's user (let's say foo). As i use portainer (As a container), i need to bind the Docker socket. $ll /var/...
0 votes
0 answers
254 views

Specifiy which SPI interface to use for SocketCAN interface

I am using a Raspberry Pi 4b with Raspberry Pi OS (kernel 5.15) and a custom CAN HAT with 3xMCP2517FD CAN controllers connected to SPI0/1/4 of the Raspberry Pi to communicate to other CAN nodes on ...
3 votes
1 answer
1k views

ss showing socket stuck in SYN-SENT with no traceable PID

On a client I see the following: [root@redacted_local ~]# ss | grep -i syn SYN-SENT 0 1 redacted_local_ip:792 redacted_server_ip:nfs ...
0 votes
0 answers
236 views

QEMU CAN Bus Emulation; error on socket bind: No such device

The goal is to run following C program in the VM. int main(int argc, char **argv) { int s, i; int nbytes; struct sockaddr_can addr; struct ifreq ifr; struct can_frame frame; ...
0 votes
0 answers
330 views

Why is /fd/1 (stdout) a socket?

I'm running a game server as a systemd service, and in the .service file, I see that StandardOutput defaults to journal. Ihsan@IhsanServerVM:/proc/28617/fd$ file 1 1: symbolic link to socket:[510374] ...
3 votes
1 answer
4k views

How to read from the systemd-journald.socket?

To my understanding systemd-journald creates a couple sockets, where it posts its logging events. # systemctl cat systemd-journald.socket | egrep -v '^ *#' [Unit] Description=Journal Socket ...
1 vote
1 answer
539 views

Is 2 pipes more expensive than 1 socketpair?

Suppose I want to launch a co-process and attach its standard input and output to the main process, what we have here are 2 options: call pipe(2) and create 2 pipes, and attach them separately to the ...
1 vote
1 answer
126 views

Sending data with raw socket over gretap

I'm trying to write an IS-IS packet to gretap interface with ISO (0x00fe) protocol type. In this case there is no ethernet header so I'm using raw socket. The gretap always puts 0x6558 as the protocol ...
0 votes
0 answers
177 views

Using chrony with non-root sockets

I'm trying to used chrony in conjunction with a C++ application I'm working on. Ideally I would like to send information to chrony using sockets rather than SHM, but it seems that chrony can only ...
1 vote
0 answers
91 views

edge triggered epoll missing 0 byte read on close

I'm trying to understand if its possible to use edge-triggered epoll and avoid the need to call recv() to read from an epoll triggered READ event multiple times, every single time... The epoll manpage ...

1
2 3 4 5
9