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
0answers
11 views

Even after ping and SSH, unable to make socket connection

I am trying to create a communication link between my (Ubuntu 20 running) PC and (Debian running) BeagleBone Black. As I have no router, I manually assign static IP addresses to both the systems and ...
1
vote
0answers
9 views

How to create a collecting socket relay with socat?

I'm using socat to forward to another port on localhost: socat tcp-l:5050,fork,reuseaddr tcp:localhost:2020 Problem: if the program running on 2020 is down, socat will answer incoming connections like:...
1
vote
1answer
15 views

Why is the socket number incremented by one in libssh2 x11 forwarding example?

I am looking to x11 forwarding example in libssh2 source (example/x11.c). In the function x11_send_receive I see this code: rc = select(sock + 1, &set, NULL, NULL, &timeval_out); if(rc > 0) ...
1
vote
1answer
44 views

Calculate TCP memory usage (does not add up)

I am running a Debian GNU/Linux 9.5 (stretch) with kernel: 4.9.0-7-amd64. I have found the culprit of a memory consumption problem I am facing to be an in-app mechanism for sending logs to FluentD ...
0
votes
2answers
59 views

where can I find socket files? ( I want unlink it and remove it..)

I'm doing debugging for a program that uses UDP socket. The program creates a socket but after that due to some other problems the program gets stuck and I cannot kill it properly. So I close the ...
0
votes
1answer
69 views

How is “multiple file descriptors refer to the same socket” created?

The Linux Programming Interface says 56.5.5 Connection Termination: close() The usual way of terminating a stream socket connection is to call close(). If multiple file descriptors refer to the same ...
0
votes
0answers
26 views

Transform xinetd to systemd service

I'm trying to migrate old application written for xinetd to systemd service. The config I have is: service server_ipv6 { id = server_ipv6 type = UNLISTED flags = ...
0
votes
0answers
10 views

Getting Connection Refused Error while testing PyPi OCPP Cental System and Charge Point

Iam trying to simulate the central system and charge point of PyPi OCPP given in the following link https://pypi.org/project/ocpp/. Central system code runs without any error. but while compiling the ...
0
votes
1answer
41 views

Script does work properly right after the first run

I have a problem with running the same script right after its first run finished. The script looks like this: #!/bin/bash ./program1 & ./program2 & ./program3 wait Briefly, the inner three C+...
1
vote
1answer
78 views

What happens when two processes listen on the same Berkeley/Unix [file] socket?

What happens when I set up two processes to listen to the same Berkeley socket? Do messages get routed to both? Neither? One of the two? If so, how? Concretely, I can start two gunicorn processes with ...
0
votes
2answers
76 views

Does every socket have its own buffers to send/receive messages?

I'm developping a C application that make extensive use of sockets. My doubt is: Does every socket that I create have its own buffers to send and/or receive messages from other sockets? In other words,...
0
votes
0answers
11 views

Problems creating a socket with NUMA

Add a command in QEMU v5.1.0 from the console to create a socket, I make it and even in properties it says it is a socket, without size, without problems, but now I am trying to do the same but, with ...
2
votes
0answers
91 views

How to get unix socket inode given its path?

Let /var/run/mysqld/mysqld.sock/ be an open socket. I can stat it to get inode of the file (here 1200) # stat /var/run/mysqld/mysqld.sock File: /var/run/mysqld/mysqld.sock Size: 0 ...
1
vote
1answer
67 views

Is there any authoritative place that says multi processes or threads accepting a listening socket is an atomic operation?

When I was reading some materials about Nginx, I noticed that one of the 2 traditional ways to accept incoming connections on a single socket is : The second of the traditional approaches used by ...
3
votes
1answer
78 views

What's the meaning of [socket:number] in /proc/pid/fd

UNIX domain sockets opened by given $PID are listed in /proc/$PID/fd/X as symlinks to [socket:ID]. I understand that it's an identifier of that socket, but what exactly is it? Is it an inode in sockfs?...
0
votes
1answer
37 views

what will happen if receiver unable to handle data velocity through socket?

I have two processes P1 (sender) and P2 (receiver). P1 uses unix-domain-socket (UDS) to send data to P2. what will happen if P1 sends data at the rate of 100 messages/second and P2 is capable to ...
0
votes
0answers
65 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
0answers
16 views

How does kernel handle previous incoming data packets after a timeout has occurred

During a TCP request hand-shake a socket at both the end of the request is created i.e. the sender creates it during the SYN and receiver creates it on ACK. This is required for connection ...
0
votes
1answer
47 views

Are socketpairs useable as signal-safe buffers?

I am thinking on a way of communication between signal handlers and the main program. Note, I use mosly non-blocking signals (a new signal can arrive even while a signal handler is executed), so I am ...
0
votes
1answer
313 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
0answers
5 views

How to manage the message rate for the SocketCAN API?

I would like to ensure that my CAN messages are being sent at a rate between 50 and 100Hz. I am also not sure how I would calculate that... I was looking at what the Broadcast Manager does in the ...
1
vote
0answers
79 views

How to monitor a UDP specific port/socket?

I have an application that receives UDP packets at port 5000. In order to be 100% sure that the application is receiving all packets (for example the RX buffer could be full and some packets could be ...
0
votes
1answer
73 views

How to determine active/passive end of TCP connection

If I inspect information about established TCP connections as returned by sock_diag(7) (or in /proc/net/tcp), how can I determine whether a given connection originated with the local side owning the ...
1
vote
1answer
55 views

How to make ss show the user who is using the socket?

I want to know which user launched the process that is using a TCP socket. I tried with ss -nte, but it only shows the uid, not the user's name. Is there a way to make ss show the user's name? Here ...
0
votes
0answers
49 views

Set can baudrate with ioctl or similar from C/C++

I'm currently setting the baudrate of my can0 with ip link: /sbin/ip link set can0 up type can bitrate 250000 I'm just wondering how to do the same from within C/C++?
0
votes
0answers
31 views

`ss -tap` with empty 'Process' column - who's the owner?

Who owns the sockets with empty Process column in ss -tap? Does the kernel (rather than kernel processes) directly own these?
3
votes
1answer
124 views

What could cause AF_NETLINK socket transactions to take many seconds?

My problem AF_NETLINK queries to the kernel intermittently take many seconds before being answered, for example in this strace trace: 10:42:38.864353 socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC, ...
0
votes
0answers
97 views

How to write to socket and have it sent to /dev/null unless there is a reader?

I want to write to something (a named pipe, a socket, idk) and if there is reader listening to the socket, the data will go to the reader(s), otherwise it just gets dumped to /dev/null. Is there some ...
0
votes
2answers
167 views

Can't open socket im systemd service

I have a software written in C language which opens a UDP socket to my server through internet. I use a systemd service approach to run the code at startup. It works fine. But in some cases which I ...
0
votes
1answer
114 views

How can I use socketpair to have two way communication between applications?

How can I use socketpair (C++ Linux) to have two way communication between (two) applications? Both applications will run on same hardware, hence I am looking for implementation of socketpair on same ...
1
vote
2answers
127 views

How does the TCP/IP protocol differentiate between clients?

If we create a listening socket it will return us a descriptor (let say root descriptor) and we are binding this descriptor to a address. Whenever a new client connection is available the root ...
0
votes
0answers
29 views

Linux Kernel Holding Packet?

I've been looking at a 3rd party program for DNS resolution (on an embedded solution) and in the code to send the DNS query to the upstream server it will connect() then send(). send() returns with ...
5
votes
5answers
677 views

How to continuously monitor PIDs connecting to local sockets?

Some local processes are connecting and disconnecting to 127.0.0.1 on port 1234. I would like to log all connection to this port (or to server process). I've tried ss -tpn | grep 1234 It shows ...
0
votes
1answer
167 views

Linux ss to inspect netlink socket, what does 'Local Address' and 'Port' mean?

What do Local Address and Port mean in ss -f netlink output? I was expecting the -n numeric version Local Address to be pid but they do not seem to match.
0
votes
2answers
46 views

Manually stopped service is not properly stopped

I have a Server, that is supposed to activate if someone tries to connect to it. For this I created a systemd socket and service that builds a proxy for my server and starts it. Thanks to this ...
1
vote
0answers
31 views

Backward ssh connection via Forward https connection (https-tunnel)

I need a construction that make possible to tunnel backward SSH via forward HTTPS. I tried to draw on a picture what I have to get. The picture shows 4 steps that explain what and how I want to make. ...
0
votes
2answers
71 views

How to use IP_TRANSPARENT to avoid too-many-TIME_WAIT

I've heard that we can avoid the issue of "too many TIME_WAIT" with the help of IP_TRANSPARENT in TCP/IP connection. In this way, it seems that a RST is used to disconnect, instead of FIN and ACK. ...
2
votes
1answer
219 views

Binding a AF_UNIX to any existing file?

Can we bind a Unix domain socket to any random existing file ? If no, how do you recognize a file that is used by a socket ?
6
votes
3answers
3k views

How to check whether a socket is listening or not?

I want to observe a socket status periodically, so I need to check the socket status by command. Currently I list all listening sockets by ss and filter them by grep. ss -l | grep -q /run/php/php7....
0
votes
0answers
77 views

How to gracefully stop process that runs a tcp server on specific port?

I have a systemd service unit that starts a tcp server on a specific port on the host machine. but on restart the port cotinue to run and if I restart the service I get an error address already in ...
0
votes
1answer
1k views

socket bind() errno 22 - no time-wait sockets

I am quite new to C & Linux and I tried to setup a TCP socket server for Data exchange with a C-Code I compiled and executed on a Ubuntu System. From a Tutorial I copied the following code (see ...
1
vote
1answer
341 views

Can't open ssh connection because max socket reached

I've a VPS and about 100 headless device connected to VPS througth ssh inverse connection. In the last days, the VPS reject ssh connections few minutes after reboot it with this message ...
1
vote
0answers
54 views

init script that run a socket continuously

I run my script(socket) as daemon with init-script : #!/bin/bash ### BEGIN INIT INFO # Provides: sock_serv # Required-Start: $local_fs $syslog $remote_fs # Required-Stop: $...
2
votes
1answer
45 views

Get SELinux permisison list associated with socket base

This shows the permissions associated with the tcp_socket class: > seinfo -c tcp_socket -x Classes: 1 class tcp_socket inherits socket { connectto name_connect ...
1
vote
1answer
482 views

Connections in /proc/[pid]/net/tcp which don't appear in /proc/net/tcp

I'm implementing code to fetch all network connections and associate them with the PIDs using them. Say, for tcp4, for each pid, I'm listing /proc/pid/fd, searching there for links to sockets, ...
0
votes
1answer
470 views

tell tar to ignore sockets - I don't want to see warnings

I have this warning message about sockets with tar: ERRO[0000] Can't add file /home/ubuntu/backup-db/.bunion.sock to tar: archive/tar: sockets not supported how can I tell tar that I don't ...
-1
votes
1answer
131 views

Shell fails to find file descriptor file when `cat`ing it [duplicate]

I created a TCP socket and tried to examine its file descriptor. I can list it without a problem: [/proc/24846/fd]$ ls -al 11 lrwx------ 1 danb danb 64 10-Sep-19 22:58 11 -> 'socket:[38186892]' ...
0
votes
1answer
442 views

Linux gives an ephemeral port that is already used and bind on any interface “::” by the NFS service

I have a Java socket server that was created with ephemeral port (bind with port 0) on "localhost". However, after it is up and running, the netstat shows that there is another process listening to ...
0
votes
1answer
87 views

Get Originating device(physical device) info for Packets trapped on Bridge

Lets assume below given is the set of net devices that my frame is intended to traverse over. eth0(1) -> bond0(2) -> bridge(3) -> vlan100(4). >>> (number) is the ifindex for each netdevice I have ...
-1
votes
1answer
148 views

producer connect to consumer with unix domain sockets

I have this: producer-client | consumer-server the consumer starts a tcp server listening on a unix domain socket (something like that), and the client (the producer) will connect to it. However, ...

1
2 3 4 5
7