Questions tagged [socket]
is a data communications endpoint for exchanging data between processes executing within the same host operating system.
431 questions
0
votes
1
answer
69
views
Do posix functions like getpeername or getsockname completely rewrite their buffers?
I am new to socket programming & I have realized that most posix functions from libc require that you pass a buffer & a length. While I can understand this helps the functions to understand ...
2
votes
1
answer
111
views
What is the cost of listening on ports?
If you would open a listening socket on every possible TCP/UDP port (so thousands in total), without actually using them, what would be the cost in terms of performance?
Is it merely an administrative ...
2
votes
1
answer
400
views
TCP checksum offloading on virtio-net paravirtualized interfaces
Consider the topology where 2 QEMU VMs running Linux Ubuntu 16.04 kernel version 4.4.0-210 have both virtio-net interfaces with TAP backends connected to the same (host) Linux bridge and an SSH ...
0
votes
1
answer
60
views
Getting ancillary data of a packet after recv() call
Is there a way to get struct msghdr or ancillary data of it for the last received packet, i.e. after the recv() call? My guess is that
recvmsg() is the only way to populate msghdr, but probably there ...
2
votes
1
answer
223
views
socat pty,echo=0 terminal option does not work
I'd use socat to redirect the STDIN/STDOUT of the process executing docker run -it ubuntu bash command to a tcp socket in listening on port 32000.
root@eve-ng:~# socat -d -d -d EXEC:'docker run -it ...
1
vote
0
answers
186
views
Using socat to redirect docker attach's STDIN/STDOUT to a TCP socket
I'd like to use socat to redirect the STDIN/STDOUT of the process executing docker attach <container-id> to a listening TCP socket on my Linux system.
root@eve-ng:/opt/unetlab# tty
/dev/pts/2
...
0
votes
0
answers
55
views
Why does Ctrl+C clear the current input line in my Python socket-based Telnet-like shell?
I'm building a simple shell server using raw Python sockets (not using telnetlib). The client connects using PuTTY with the Telnet connection type.
The server displays a basic prompt like:
[user@...
0
votes
1
answer
103
views
Issue in l2cap test - Bluez
I'm currently testing the bluez tools like l2ping & l2test, So my intention was to interface between two devices through l2cap layer.
I have cloned the bluez repository on two raspberry pi devices,...
0
votes
0
answers
112
views
/dev/log is a socket not a symbolic link
I am trying to understand why one of my system has /dev/log as a socket and other has /dev/log as a symbolic link.
[ec2-user@ip-171-31-12-17 log]$ file /dev/log
/dev/log: symbolic link to /run/systemd/...
0
votes
1
answer
136
views
Configure mpd to only start a UNIX socket
Running mpd without any bind_to_address in the config starts a working UNIX socket at /run/user/1000/mpd/socket but also starts a network socket at 0.0.0.0:6600 / [::]:6600.
I would like to have only ...
7
votes
2
answers
2k
views
ICMP echo traffic doesn't NEED to be operated on a raw socket any more than UDP or TCP traffic does, so why is it done that way?
If you've ever tried writing tools that depend upon ICMP echo requests, you've inevitably run into the same problem as everyone else: you can't do it unless your tool is running as root.
When you try ...
1
vote
1
answer
184
views
Ham Radio simulator: live streaming microphone audio between 2 browsers, connected via ubuntu 22
I am trying to simulate a radio with a PTT button.
Connected users should be able to live voice chat in the group, one at a time, while holding a button.
I have a Ubuntu 22.04 server running, with ...
0
votes
0
answers
168
views
Postfix/Dovecot configuration to gmail as relay
Does any one have a complete configuration of using Dovecot to handle OAuth2 tokens to allow Postfix to send mail to gmail? Most use cases found are either too old or not complete. I have done the ...
1
vote
2
answers
1k
views
OpenSSH SSH daemon: IPv4-socket missing on Ubuntu 24.04
I stumbled over the following issue, while debugging ssh connections.
I have a Ubuntu 24.04 with openssh-server installed.
The corresponding systemd-service is running (now named ssh.service & ssh....
10
votes
5
answers
1k
views
How to check multiple hosts for simple connectivity?
I need a tool that tells me if a connection to a host is open or not -- no data to send or receive, just see if the connection is successful.
Today I use telnet.
$ telnet myhost myport
Trying 192.168....
1
vote
1
answer
84
views
WebSocket Error "Unexpected close, re-opening websocket" after moving Focalboard to a subdirectory in Nginx
I'm trying to configure Focalboard to run in a specific subdirectory using Nginx. I followed the steps from the official Focalboard documentation and was able to set it up normally. However, after ...
0
votes
1
answer
274
views
What is the structure that is stored in UDP socket's send/receive buffers?
I noticed that receive and send buffers of UDP sockets have an overhead of approximately 600 bytes. That is, when I write 10 bytes of data to UDP socket, the actual structure stored in send/receive ...
0
votes
1
answer
254
views
How to give the user account proper rights to premission for /run/seatd.sock?
I'm going to start weston in a user service. Starting weston in a super user service is no problem.
But when I'm starting weston by the regular user, the weston won't start due to this file
Could not ...
1
vote
0
answers
37
views
LIsten on a port, check another port, if no response run a script, then tunnel connection to that port?
So, I want to use an SSH tunnel proxy occasionally. But I don't want to fire it up manually every time. And this is a laptop so if I just start the SSH tunnel at startup it might die of an occasional ...
2
votes
1
answer
342
views
Unicast UDP socket tx buffer fills awaiting ARP
I have an 'understanding' question but it does have a real-world case that I've simplified out. Consider this sample network (with simplified IPs):
From left to-right:
Three hosts S1-S3 (IPs , ...
2
votes
0
answers
99
views
noVNC takes long time to connect to x11vnc on docker
I have x11vnc running inside a docker container with alpine as base image. (5900 is exposed and mapped to hosts 5900) I use Xvfb as well. I run x11vnc inside the container using this command
x11vnc -...
0
votes
0
answers
390
views
Linux Systemd Socket does not work
i've got the Systemd error Message:
Sep 20 15:54:29 test systemd[9298]: HostnameResponder.socket: Failed to create listening socket (0.0.0.0:101): Permission denied
Sep 20 15:54:29 test systemd[1]: ...
0
votes
1
answer
67
views
USB/UART to Network Interface
I have a modem that works via a USB interface (read/write messages to FTDI) but, can I turn it into an actual network interface so I can interact to it via sockets (SOCK_DGRAM)? Perhaps there are ...
1
vote
0
answers
870
views
Device or resource busy on AWS Lambda
Fresh deployed Python FastAPI application to AWS Lambda.
Python application uses ldap3 module to authorize user signing in against Windows Active directory (hosted on AWS Directory Services). However ...
1
vote
1
answer
386
views
Linux kernel: Get status of bound, but otherwise unused sockets
I have a problem with the Linux kernel,
regarding the status of ports that are bound through an application,
but not used via listen() or connect().
E.g., Entering the following lines in a python ...
0
votes
1
answer
139
views
How can I have multiple TCP clients connected to server ttyS0?
I'm trying to test following envirorment:
One server (it's a router, It has busybox and few other cmd) with a a physical serial port and and open socket
#tcpsvd -v 0.0.0.0 -p 999 cat /dev/ttyS0
...
0
votes
1
answer
452
views
What is a port?
I have been running an Apache web server for numerous years and have been using ports as a medium to serve requests.
Recently, I began using Unix sockets to serve MySQL requests. The function of Unix ...
2
votes
1
answer
153
views
Ubuntu server, packets from outside network not reaching local socket but seen on tcpdump
I am running Ubuntu server 22.04, and have a peculiar port forwarding issue with a local machine. This machine has two Ethernet interfaces and the connected enp1s0 interface has an IP address 192.168....
2
votes
1
answer
245
views
How do I automatically set the target context for a .sock file to be **httpd_var_run_t** so that nginx can connect to and write to the socket?
The original file context for /run/unicorn.sock is tcontext=system_u:object_r:var_run_t:s0
How do I have the file context automatically be system_u:object_r:httpd_var_run_t:s0 when I start the socket ...
1
vote
0
answers
525
views
How do I setup and start a unix socket in Red Hat? [closed]
I couldn't find any specific guides for creating a unix socket in Red Hat Enterprise Linux (RHEL version 9.3) so I used this guide.
After creating the gunicorn.socket and gunicorn.service file in /...
0
votes
1
answer
84
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 = ...
2
votes
1
answer
2k
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
0
answers
373
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 ...
0
votes
1
answer
196
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
179
views
Check if an ssh ControlMaster 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
0
answers
316
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 ...
0
votes
1
answer
385
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
2k
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
631
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
1
answer
2k
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 ...
3
votes
2
answers
3k
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 ...
2
votes
0
answers
145
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 ...
1
vote
2
answers
399
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....
0
votes
1
answer
148
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
1k
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
98
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 ...
1
vote
1
answer
649
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
0
answers
218
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 ...
2
votes
0
answers
144
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=...
0
votes
1
answer
1k
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 ...