DDVSocket edits
This commit is contained in:
		
							parent
							
								
									31b88fc9d8
								
							
						
					
					
						commit
						fd2783c8de
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -13,8 +13,6 @@ bool socketBlocking = false; | ||||||
| 
 | 
 | ||||||
| int DDV_OpenUnix(const char adres[], bool nonblock = false){ | int DDV_OpenUnix(const char adres[], bool nonblock = false){ | ||||||
|   int s = socket(AF_UNIX, SOCK_STREAM, 0); |   int s = socket(AF_UNIX, SOCK_STREAM, 0); | ||||||
|   int on = 1; |  | ||||||
|   setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); |  | ||||||
|   sockaddr_un addr; |   sockaddr_un addr; | ||||||
|   addr.sun_family = AF_UNIX; |   addr.sun_family = AF_UNIX; | ||||||
|   strcpy(addr.sun_path, adres); |   strcpy(addr.sun_path, adres); | ||||||
|  | @ -35,6 +33,8 @@ int DDV_OpenUnix(const char adres[], bool nonblock = false){ | ||||||
| int DDV_Listen(int port){ | int DDV_Listen(int port){ | ||||||
|   int s = socket(AF_INET, SOCK_STREAM, 0); |   int s = socket(AF_INET, SOCK_STREAM, 0); | ||||||
| 
 | 
 | ||||||
|  |   int on = 1; | ||||||
|  |   setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); | ||||||
|   struct sockaddr_in addr; |   struct sockaddr_in addr; | ||||||
|   addr.sin_family = AF_INET; |   addr.sin_family = AF_INET; | ||||||
|   addr.sin_port = htons(port);//port 8888
 |   addr.sin_port = htons(port);//port 8888
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Thulinma
						Thulinma