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
1answer
23 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
38 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
3 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
34 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
44 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
48 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
16 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
12 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
33 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
29 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
53 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
54 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
74 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
28 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
254 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
68 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
1answer
31 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
26 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
34 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. ...
1
vote
1answer
116 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 ?
0
votes
0answers
75 views

Get listening ports of Bluetooth

I’m trying to get all sockets connected or listening on a system. However, I saw that, for example, Bluetooth is not appearing. I tried to use the commands ss and netstat but without success. Netstat ...
6
votes
3answers
857 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
137 views

Unix domain sockets: What is the significance of send-q value in ss utility output for unix domain stream socket?

I am using ss utility to debug a possible message loss (not yet sure) between two applications communicating using unix stream sockets in a linux system. In the below output, app_yyy sends a message ...
0
votes
0answers
38 views

How are socket typed files(S_IFSOCK) used in Linux ext4 filesystem?

In kernel 5.4 code, special inode for device files and FIFOs is hooked to their special f_ops, but sockets are left dangling. void init_special_inode(struct inode *inode, umode_t mode, dev_t rdev) { ...
0
votes
0answers
35 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
595 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
202 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
47 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
19 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 ...
0
votes
1answer
281 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
228 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
84 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
309 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
64 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 ...
0
votes
0answers
30 views

Can we add more granular filters in Netlink

I've opened a netlink socket to receive port updates. fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); struct sockaddr_nl sa = { .nl_family = AF_NETLINK, .nl_pad = 0, .nl_pid ...
0
votes
0answers
19 views

Networking, netstat -na, RWind Size Dying?

So I have a windows 7 server setup (TCP) for multicasting outputting some data on the IP: 192.168.1.50:15000. It's just ASCII text that is being updated every second, but it could vary between .5 ...
-1
votes
1answer
123 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, ...
0
votes
0answers
35 views

I want to know how we can reduce the value of total in ss -s command

i have tried everything to overcome with this problem, i have tried the reboot and restart of multiple application but still the value is very High. we have applied the monitoring check on sar -n SOCK ...
1
vote
2answers
469 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:...
0
votes
2answers
41 views

How can I know what is the binary value I receive in a tcp socket?

in a socket created in the following way: nc -k -l 3111 I receive this message: �...
0
votes
1answer
81 views

delete tmux socket file created with -S after session exit

I create a tmux session and want to share it with a different user. So I start tmux like this: tmux -S /tmp/tmuxshareds new-session -s 'mysession' chgrp tmuxshare /tmp/tmuxshareds This works fine ...
0
votes
1answer
218 views

How can a client talk to another client using unix domain sockets?

Using bash we might have something like this with netcat: nc -lk -U /my/fifo | while read line; do # line => {"client_id":123} done; clients send data like this: echo '{"client_id":123,"data":...
1
vote
0answers
231 views

How to deal efficiently with “Address already in use”?

If I attempt to run my own Python program which listens on a particular port, I may get: socket.error: [Errno 98] Address already in use If the program didn't terminate gracefully. While this may ...
0
votes
1answer
483 views

Systemd socket: listendatagram vs listenstream

In this very nice presentation of systemd the first speaker presents two cases of socket-based service activation. The first unit file corresponds to a tftp socket and it is the following tftp....
-1
votes
2answers
94 views

Client to Client Communication

I need to connect to a Raspberry-pi from an Android, over a long distance (so via the internet). My aim is to switch a controller circuit from a remote location, by using internet and android app. ...
-1
votes
3answers
917 views

How to send literal string over TCP (netcat/socat-like), but provided by command arguments?

If I want to send a string over TCP in a shell environment, I can do something like: echo text | nc 1.2.3.4 9876 Cool. Interactively, that works. Now I want to do this programmatically by spawning a ...
0
votes
1answer
201 views

How can I find out which processes are using or listening on which network interfaces?

ifconfig lists several network interfaces, some of which are virtual ones. How can I find out which processes are using or listening on which network interfaces? Thanks. $ ifconfig docker0: flags=...
0
votes
1answer
685 views

What IP address(es) can't be bound to a listening socket?

What IP address(es) can't be bound to a listening socket? For example, can a server process bind 255.255.255.255 to a listening socket? Thanks.
1
vote
1answer
320 views

Why does postgresql server have a `localhost:57504` to `localhost:57504` UDP “connection”?

$ sudo netstat -ap | grep postg tcp 0 0 localhost:postgresql 0.0.0.0:* LISTEN 1567/postgres udp 0 0 localhost:57504 localhost:57504 ...
1
vote
1answer
54 views

Why is mysql server accepting nonlocal request, while postgresql server is not?

By default configurations, why is mysql server accepting nonlocal request, while postgresql server is not? $ nmap -p0-65535 192.168.1.97 Starting Nmap 7.60 ( https://nmap.org ) at 2019-03-20 14:34 ...

1
2 3 4 5
7