Questions tagged [socket]

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

129 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6 votes
0 answers
959 views

Which socket is gnome-shell reading from continuously?

strace shows that the GNOME shell is continuously trying to read from a socket, which is often not available (or doesn't contain any data to read from): strace -p gnome-shell-pid -e trace=recvfrom ...
user55981's user avatar
5 votes
0 answers
791 views

AF_UNIX: Using recv() to receive a message sent with sendmsg()

The function prototype for the sendmsg() function is as follows: ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags); and the msghdr struct is such: struct msghdr { void *...
novice's user avatar
  • 429
5 votes
0 answers
887 views

Implications of increasing igmp_max_memberships

I am writing an application that will subscribe to 150+ multicast groups. It appears the linux default number of multicast subscriptions is 20 which can be increased via sysctl -w net.ipv4....
schuess's user avatar
  • 171
3 votes
0 answers
156 views

Linux: Are sockets always on device 00:08?

After opening up a socket in a C program, I ran fstat on it and printed out the major and minor device numbers. I got a major number of 0 and a minor number of 8. Looking at the Linux kernel ...
Daniel Walker's user avatar
3 votes
0 answers
521 views

IPTables log connection pid on OUTPUT chain

I'm trying to find pid of a socket using iptables OUTPUT chain log, or even better adding it into the log. My current iptable rule: sudo iptables -A OUTPUT -j LOG --log-prefix='[PID]' --log-level 7 --...
Or Yaacov's user avatar
3 votes
0 answers
976 views

When does the kernel cut UDP datagram into MTU chunks?

I need your help/hints/remarks on an issue I'm having. Thanks Here is some context : I have two application(A1 & A2) handling PDUs with a max size of 1700bytes. Each app is on a different card(C1 ...
SOKS's user avatar
  • 103
3 votes
0 answers
157 views

Automatically set file group and permissions not by inheriting from a directory

I have set up a webserver daemon on a VPS. This daemon is run by its own service user, named "node". I have already assigned node's home directory a "siteadmin" owning group that I am in, set chmod g+...
senseless's user avatar
3 votes
0 answers
2k views

Netlink access inside a network namespace

I'm trying set up an IPsec gateway (strongSwan) on a Raspberry Pi 2. The Pi was already providing a number of services on the LAN using a private IP address. My initial attempt to turn it into an ...
Saran Tunyasuvunakool's user avatar
3 votes
0 answers
38 views

Limit access/transmit rights on NIC to a single user application

I currently have a RT patched linux machine and I need to have full and undelayed access to my Wired interface card. I am running a realtime non-preemtable user application which sends a couple of ...
Rami's user avatar
  • 43
3 votes
0 answers
776 views

Read but not write access to a socket on Linux, what can one do with that?

On a server installation, I found sockets writable by group, but only readable by others. I assume that the latter has no effect, as my understanding was that write access is needed to be able to work ...
user avatar
3 votes
0 answers
2k views

X11 bad access at first try but working on successive tries

I use the following setup to forward X11 output from my local machine to the server. I will outline the setup: X11 server and the client are on the same local machine. The X11 server runs on my local ...
lord.garbage's user avatar
  • 2,353
3 votes
0 answers
992 views

Does epoll give available bytes to read or write, and threshold feature?

kqueue gives available bytes to send or receive if file descriptior (such as socket) gets signal. and, kqueue gives threshold feature, for example, it does not signal until sufficient bytes are ...
Hyunjik Bae's user avatar
2 votes
0 answers
33 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 ...
AJMansfield's user avatar
2 votes
0 answers
59 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=...
Joel Olsteen's user avatar
2 votes
0 answers
4k views

How to "cat" a socket?

So to read and write to a socket: Write to a socket: echo "hello" > /dev/tcp/192.168.0.144/27002 Read from socket: netcat -p 27002 -l BUT... I would like to read a socket using "...
jdl's user avatar
  • 865
2 votes
0 answers
2k 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 ...
matt's user avatar
  • 537
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:...
membersound's user avatar
2 votes
0 answers
183 views

How to run adb in initramfs?

Seem my hook is work(sometime first run is failed but again run is seem no any library problem), Seem lack socket support in initramfs?my system is debian 9.Seem normal debian system provide socket ...
illiterate's user avatar
2 votes
0 answers
381 views

Does SO_ATTACH_FILTER reset the socket's receive buffer?

If a filter is already set and there are unprocessed packets in the sockets receive buffer will calling SO_ATTACH_FILTER to set a new updated filter flush the buffer, i.e is it the same as BSD's ...
C.Sutherland's user avatar
2 votes
1 answer
949 views

UDP multicast client over ipv6

Simple Python UDP Server: trouble receiving packets from clients other than localhost I am trying to listen datagrams over ipv6. Here are the messages I am interrested in: $ sudo tcpdump | grep ...
Vorac's user avatar
  • 3,057
2 votes
0 answers
309 views

how to list all the epoll requests in linux

I used to use netstat for displaying all listening sockets. How can we list epoll requests on the sockets? Or is there anyway to dislay epoll requests using netstat?
suresh's user avatar
  • 121
2 votes
0 answers
1k views

UDP buffer overrun and old datagram clearing

I am reading UDP datagrams on a linux server at 700,000 per second from HDL32 LIDAR system. Interface is ipv4. Sockets are set to SOREUSADDR. I turn on the LIDAR, start up socket program, it started ...
daemondave's user avatar
2 votes
1 answer
958 views

Which Privileges Should Assign To Create Raw Sockets

I want to run an ICMP command to ping an IP Adress at Java: InetAddress.getByAddress("XXX.XXX.XXX.XXX".getBytes()).isReachable(1000); However there is a security restriction that: Normal users are ...
kamaci's user avatar
  • 153
2 votes
0 answers
785 views

Emulate console by sending data on one UDP port, and receive text from another

Note: I also posted this question on SuperUser, because I'm not sure where it belongs I'm trying to establish a "console-like" connection with a National Instruments cRIO-FRC. It broadcasts its ...
Alexander's user avatar
  • 229
2 votes
1 answer
688 views

Is there a system call to bind a file descriptor directly into another?

A read() & write() loop would probably be as good as what I'm looking for, but nevertheless is anything like that around or is it impossible because of an obstacle I didn't envisage ? I'm curious
user avatar
2 votes
0 answers
239 views

Last data traffic time for a TCP socket

Is it possible, to find out when was the last time there was any traffic on an opened TCP socket? Keepalive and timeout timers are based on this statistic, so I guess it has to be stored somewhere. ...
er453r's user avatar
  • 867
1 vote
0 answers
90 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 ...
Rob A's user avatar
  • 11
1 vote
0 answers
245 views

How is the hardware TX queue selected by default?

NICs may have multiple hardware RX and TX queues, and there are several methods which allow choosing which RX and TX queues are used for a given flow/packet, though most are focused on the RX side. ...
BeeOnRope's user avatar
  • 547
1 vote
1 answer
144 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 ...
Nandor Takacs's user avatar
1 vote
1 answer
342 views

Number of open sockets in /proc/pid/fd does not agree with netstat

I'm running into a weird socket issue when running my own crawler. It opens and cloees a lot of TCP sockets rapidly due to the protocol design. It's something I have to live with. I'm very sure in ...
Mary Chang's user avatar
1 vote
0 answers
210 views

Turn a script do while to a systemctl service to intercept a tcp connection state

I made a little script that refresh browser, when web-server is down and connection is lost, with an infinite loop do/while true. I want to turn it in a service for a better and clean solution. The ...
Alessandro's user avatar
1 vote
0 answers
199 views

dovecot: Force TCP socket disconnect on imap login failure?

I'm running dovecot 2.2.13 under Debian 8. I'd like to force an immediate TCP socket disconnect after any imap login attempt that fails. Right now, if invalid credentials are supplied during an imap ...
HippoMan's user avatar
  • 595
1 vote
0 answers
90 views

XDMCP locally using Unix sockets

Is there any way to start a XDMCP session, say with Xephyr in LightDM, locally through Unix Sockets instead of IP? For performance I was wondering if, somehow, I can avoid any network stack working ...
igorkattar's user avatar
1 vote
0 answers
639 views

How to listen the requests sent to a unix socket

I'm learning docker and wanted to see the API commands sent by the client to the docker server/engine. I know that the communication between the two processes happens via /var/run/docker.sock. Is ...
sudeepdino008's user avatar
1 vote
0 answers
632 views

Custom linux driver for custom Layer 3 protocol

We're designing a custom communication using a custom physical layer which will be used in a cubesat and I'm looking on how to create the custom layer 3 driver for linux (like ipv4 but not, the ...
Cedric's user avatar
  • 11
1 vote
0 answers
562 views

socat bidrectionally with a shell script. echo, read, then hand off to socat

There is a VMM which doesn't conform to the the standard VSOCK implementation: Firecracker For each guest it creates a v.sock unix socket file The ordinary VSOCK-CONNECT:cid:1234 then becomes: UNIX-...
Jack Fleming's user avatar
1 vote
0 answers
406 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:...
membersound's user avatar
1 vote
0 answers
510 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 ...
M.E.'s user avatar
  • 589
1 vote
0 answers
91 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. ...
LovingFox's user avatar
1 vote
0 answers
314 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: $...
binakh's user avatar
  • 23
1 vote
1 answer
234 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 ...
dhanlin's user avatar
  • 61
1 vote
0 answers
1k 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 ...
AlphaCentauri's user avatar
1 vote
0 answers
396 views

Linux kernel does not handle orphaned sockets, why not?

This was originally posted to serverfault but was voted as off topic by the community. Let me just preface this question by mentioning I understand the why/how/where/when of the Linux kernel socket ...
ChumiestBucket's user avatar
1 vote
0 answers
1k views

Retrieving the SO_INCOMING_CPU of a UDP Socket?

The socket API provides an SO_INCOMING_CPU option, the details of which are provided in the man page: SO_INCOMING_CPU (gettable since Linux 3.19, settable since Linux 4.4) Sets or gets ...
John Saxton's user avatar
1 vote
0 answers
205 views

Websocket server won't connect if started via PHP

I have a websocket server written in Node. The following instruction, when executed from the command line starts the websocket server successfully: nohup "/root/.nvm/versions/node/v8.11.1/bin/node" "/...
I wrestled a bear once.'s user avatar
1 vote
0 answers
1k views

Increase buffer size of Unix domain datagram socket in systemd unit file

I use Unix domain datagram socket for unidirectional daemon communication. Process writing to the socket may get blocked on write(), at some peaks of computation, because reading process takes more ...
Al Bundy's user avatar
  • 181
1 vote
0 answers
43 views

Regulating user-daemons from listening on unprivileged ports (preventing server spoofing)?

If I have a port >1024 but that I want to reserve to one executable how can I ensure that no other executable can open and listen to a socket on that port? /usr/bin/foo_srv -p 8080 /usr/bin/bar_srv -...
Evan Carroll's user avatar
  • 30.4k
1 vote
0 answers
127 views

Show bound socket (but not listen) process

I am trying to understand how bind() works. I open a socket, and bind it to port 5001, but I don't execute listen() on it: sockfd = socket(AF_INET, SOCK_STREAM, 0); /* Initialize socket structure */ ...
javierdvalle's user avatar
1 vote
1 answer
1k views

Find the creator of a particular Unix socket

I'm struggling to find out which process exactly created a Unix socket. I've read couple posts about it like using lsof -nl (which generally gets the pid of a process which listens to Unix socket), ...
Ojs's user avatar
  • 111
1 vote
0 answers
497 views

Reading MLDv2 queries using an IPv6 socket

I have mrd6 installed on my raspberry pi. It registers with a local interface (tun0) and periodically transmits MLDv2 queries over it. According to [RFC3810], MLDv2 message types are a subset of ...
S.P's user avatar
  • 111