Questions tagged [socket]

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

398 questions
159
votes
6 answers

How can I communicate with a Unix domain socket via the shell on Debian Squeeze?

I’m running a Debian Squeeze web server. I’ve installed memcached on it, and configured memcached to listen on a Unix domain socket (at /tmp/memcached.sock), as it only needs to receive messages from the website, which lives on the same server. It…
Paul D. Waite
  • 3,527
  • 5
  • 21
  • 21
80
votes
6 answers

What is a socket?

Could someone explain to me what a socket is? I see it in many acronyms in context of SSL, etc. Also, why is it called a socket? Is it purely because it was what a name they invented? Or was it the first name they came up with?
chrisjlee
  • 8,283
  • 16
  • 49
  • 54
76
votes
8 answers

Who's got the other end of this unix socketpair?

I want to determine which process has the other end of a UNIX socket. Specifically, I'm asking about one that was created with socketpair(), though the problem is the same for any UNIX socket. I have a program parent which creates a…
Jonathon Reinhart
  • 1,821
  • 1
  • 16
  • 20
75
votes
1 answer

How do I find out more about socket files in /proc/fd?

Looking in /proc/$mypid/fd/, I see these files lrwx------ 1 cm_user cm_user 64 Oct 14 03:21 0 -> /dev/pts/36 (deleted) lrwx------ 1 cm_user cm_user 64 Oct 14 03:21 3 -> socket:[1424055856] lrwx------ 1 cm_user cm_user 64 Oct 14 03:21 4 ->…
benhsu
  • 905
  • 1
  • 6
  • 5
63
votes
2 answers

Performance of unix sockets vs TCP ports

For example on php-fpm: #listen = 127.0.0.1:9000 listen = /var/run/php-fpm/php-fpm.sock Is there any major performance differences between using unix socket-based listeners over TCP ports? (Not just for PHP but in general. Is it different for each…
Jason
  • 1,714
  • 5
  • 25
  • 30
54
votes
5 answers

Are FIFO, pipe & Unix domain socket the same thing in Linux kernel?

I heard that FIFOs are named pipes. And they have exactly the same semantics. On the other hand, I think Unix domain socket is quite similar to pipe (although I've never made use of it). So I wonder if they all refer to the same implementation in…
Justin
  • 703
  • 1
  • 5
  • 8
44
votes
4 answers

Simple shell script to send socket message

For testing purposes I need to create a shell script that connects with a remote IP>Port and sends a simple text TCPIP Socket message.
Bachalo
  • 1,061
  • 4
  • 12
  • 23
40
votes
2 answers

/proc/PID/fd/X link number

In Linux, in /proc/PID/fd/X, the links for file descriptors that are pipes or sockets have a number, like: l-wx------ 1 user user 64 Mar 24 00:05 1 -> pipe:[6839] l-wx------ 1 user user 64 Mar 24 00:05 2 -> pipe:[6839] lrwx------ 1 user user 64 Mar…
Thanatos
  • 897
  • 1
  • 6
  • 17
37
votes
3 answers

Why are TCP/IP sockets considered "open files"?

I need some assistance grasping what I'm sure is a fundamental concept in Linux: the limit for open files. Specifically, I'm confused on why open sockets can count towards the total number of "open files" on a system. Can someone please elaborate…
Mike B
  • 8,769
  • 24
  • 70
  • 96
35
votes
2 answers

What does the @ symbol denote in the beginning of a unix domain socket path in Linux?

When I run netstat --protocol unix or lsof -U I see that some unix socket paths are prepended with @ symbol, for example, @/tmp/dbus-qj8V39Yrpa. Then when I run ls -l /tmp I don't see file named dbus-qj8V39Yrpa there. The question is what does that…
golem
  • 2,278
  • 5
  • 20
  • 32
35
votes
3 answers

How do I reserve ports for my application?

How do I reserve a list of ports for my custom applications? To be specific, the product I'm creating has a lot of processes and a lot of intercommunication between them. The problem I'm having is that - every once in a while - the OS steals my…
Michael Baker
  • 453
  • 1
  • 4
  • 4
34
votes
2 answers

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-line CPU(s) list: 0-55 Thread(s) per core: …
cph_sto
  • 443
  • 1
  • 4
  • 7
32
votes
2 answers

Why is socket path length limited to a hundred chars?

On Unix systems path names have usually virtually no length limitation (well, 4096 characters on Linux)... except for socket files paths which are limited to around 100 characters (107 characters on Linux). First question: why such a low…
WhiteWinterWolf
  • 2,851
  • 2
  • 21
  • 37
31
votes
3 answers

Is there a file for each socket?

"Everything is a file" in the UNIX World. Above sentence is famous. When I run echo "hello programmer" >> /dev/tty1 , I can watch the given string on TeleType 1 , .... What and where is file per each socket? Suppose my friend connects to my PC, and…
PersianGulf
  • 10,728
  • 8
  • 51
  • 78
29
votes
4 answers

How does the server find out what client port to send to?

As I understand it this is what happens when a client makes a connection request: The server will be bound to a particular port number. The port number is always bound to a listening process. Since only the server is listening for incoming…
Subi Suresh
  • 495
  • 2
  • 6
  • 12
1
2 3
26 27