mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: reuse the socket
This commit is contained in:
		
							parent
							
								
									d44fdabea1
								
							
						
					
					
						commit
						71e3052a33
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -2723,13 +2723,17 @@ error:
 | 
			
		|||
static int make_inet_socket(struct impl *impl, uint32_t address, uint16_t port)
 | 
			
		||||
{
 | 
			
		||||
	struct sockaddr_in addr;
 | 
			
		||||
	int res, fd;
 | 
			
		||||
	int res, fd, on;
 | 
			
		||||
 | 
			
		||||
	if ((fd = socket(PF_INET, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0)) < 0) {
 | 
			
		||||
		res = -errno;
 | 
			
		||||
		goto error;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	on = 1;
 | 
			
		||||
	if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (const void *) &on, sizeof(on)) < 0)
 | 
			
		||||
		pw_log_warn(NAME" %p: setsockopt(): %m", impl);
 | 
			
		||||
 | 
			
		||||
	spa_zero(addr);
 | 
			
		||||
	addr.sin_family = AF_INET;
 | 
			
		||||
	addr.sin_port = htons(port);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue