Questions tagged [socket]

A socket is an abstract network construct with a sending and receiving side. In most modern operating systems (OS) there are device representations, and programming tools to address sockets.

564 questions
222
votes
3 answers

What is the difference between Unix sockets and TCP/IP sockets?

It's from this answer: https://stackoverflow.com/questions/2482411/is-this-pdo-bug-fixed-now/2482424#2482424 When the host is "localhost", MySQL Unix clients use a Unix socket, AKA Unix Domain Socket, rather than a TCP/IP socket for the connection,…
apache
  • 3,227
  • 7
  • 27
  • 25
132
votes
8 answers

How to forcibly close a socket in TIME_WAIT?

I run a particular program on linux which sometimes crashes. If you open it quickly after that, it listens on socket 49201 instead of 49200 as it did the first time. netstat reveals that 49200 is in a TIME_WAIT state. Is there a program you can…
Rehan
  • 1,423
  • 2
  • 10
  • 5
70
votes
7 answers

How to force MySQL to connect by TCP instead of a Unix socket?

I would like to analyze mysql traffic. Right now, all mysql requests are sent to the MySQL unix socket: unix 2 [ ACC ] STREAM LISTENING 3734388 15304/mysqld /var/run/mysqld/mysqld.sock I'm trying to disable that socket to…
Max
  • 3,523
  • 16
  • 53
  • 71
54
votes
3 answers

Unix socket vs TCP/IP host:port

Could someone please describe to me the pros and cons of using a Unix socket file vs a tcp/ip localhost:port when setting up services on a server (Ubuntu, FWIW)? In this particular instance it's for a Python WSGI server (uWSGI) but I'm just…
Ludo
  • 1,099
  • 3
  • 10
  • 11
51
votes
4 answers

Create Unix Named Socket from the Command Line

Is there a command similar to mkfifo but for domain sockets?
benmmurphy
  • 755
  • 1
  • 7
  • 8
48
votes
7 answers

How to find other end of unix socket connection?

I have a process (dbus-daemon) which has many open connection over UNIX sockets. One of these connections is fd #36: =$ ps uw -p 23284 USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND depesz 23284 0.0 0.0 24680 1772 ? …
user13185
44
votes
7 answers

Forward local port or socket file to remote socket file

Quick question - I run two linux boxes, one my own desktop and the other my VPS. For security reasons on the VPS end I opted for socket connections to MySQL (/var/run/mysqld/mysql.sock). I know I can tunnel like this: ssh -L 3307:127.0.0.1:3306…
user32616
43
votes
4 answers

How to automatically restart a service on failure in Linux

On Windows, you can set what should happen if/when a service fails. Is there a standard way of achieving the same thing on Linux (CentOS in particular)? A bigger part of my question is: how do you handle sockets that have been left open - for…
Pryo
  • 655
  • 1
  • 5
  • 11
30
votes
5 answers

Need to increase nginx throughput to an upstream unix socket -- linux kernel tuning?

I am running an nginx server that acts as a proxy to an upstream unix socket, like this: upstream app_server { server unix:/tmp/app.sock fail_timeout=0; } server { listen ###.###.###.###; server_name whatever.server; …
Ben Lee
  • 666
  • 2
  • 9
  • 24
27
votes
6 answers

Network Error: no buffer space available

After some time of running fine, one of our Windows XP SP3 machines does not open some(!) new TCP/IP connections anymore. Putty says Network Error: no buffer space available, IE won't open any new connections but e.g. network drive mappings still…
braindump
  • 363
  • 1
  • 3
  • 8
25
votes
2 answers

When to use a MySQL socket and when to use a host:port?

Many applications allow me to connect to Mysql using a username, password host and port. Some allow me to configure a socket instead of the host:port. Is there any clear benefit of one over the other? I can imagine that a socket only works when…
berkes
  • 2,205
  • 3
  • 18
  • 19
25
votes
7 answers

What should mysqld.sock contain, why don't I have it?

Does anyone know why my /var/run/mysqld/mysqld.sock socket file would not be on my computer when I install (or reinstall) MySQL 5.1? Right now, when I try to start up a server with mysqld, I get errors like Can't connect to local MySQL server…
egbutter
  • 353
  • 1
  • 3
  • 7
24
votes
5 answers

How to get a linux network log?

We have a java server running in linux at a specific port that accepts persistent connections for thousands and thousands of users. Recently our clients are not able to connect with a time out error. We suspect the traffic is getting too high but…
erotsppa
  • 2,113
  • 6
  • 23
  • 24
22
votes
3 answers

Sockets found by lsof but not by netstat

I have an application which is running out of file descriptors, apparently by opening sockets, but I can't find out exactly what these sockets do. These appear in the lsof output as java 9689 appuser 1010u sock 0,5 263746675 can't…
Robert Munteanu
  • 1,644
  • 5
  • 23
  • 41
19
votes
3 answers

Sharing unix socket via docker volume - permission denied

I try to share my php5-fpm socket via a volume with my nginx webserver. Fpm and nginx are running in different containers and I want to get them working via a shared volume where I place the socket file from fpm. 2014/04/13 10:53:35 [crit] 33#0: *1…
soupdiver
  • 807
  • 2
  • 9
  • 26
1
2 3
37 38