2727
2828#if defined(FEAT_NETBEANS_INTG ) || defined(PROTO )
2929
30- /* TODO: when should this not be defined? */
31- #define INET_SOCKETS
32-
3330/* Note: when making changes here also adjust configure.in. */
3431#ifdef WIN32
3532# ifdef DEBUG
4946# define sock_close (sd ) closesocket(sd)
5047# define sleep (t ) Sleep(t*1000) /* WinAPI Sleep() accepts milliseconds */
5148#else
52- # ifdef INET_SOCKETS
53- # include <netdb.h>
54- # include <netinet/in.h>
55- # else
56- # include <sys/un.h>
57- # endif
49+ # include <netdb.h>
50+ # include <netinet/in.h>
5851
5952# include <sys/socket.h>
6053# ifdef HAVE_LIBGEN_H
@@ -216,16 +209,12 @@ netbeans_close(void)
216209 static int
217210netbeans_connect (char * params , int doabort )
218211{
219- #ifdef INET_SOCKETS
220212 struct sockaddr_in server ;
221213 struct hostent * host ;
222- # ifdef FEAT_GUI_W32
214+ #ifdef FEAT_GUI_W32
223215 u_short port ;
224- # else
225- int port ;
226- # endif
227216#else
228- struct sockaddr_un server ;
217+ int port ;
229218#endif
230219 int sd ;
231220 char buf [32 ];
@@ -309,7 +298,6 @@ netbeans_connect(char *params, int doabort)
309298 channel_init_winsock ();
310299#endif
311300
312- #ifdef INET_SOCKETS
313301 port = atoi (address );
314302
315303 if ((sd = (sock_T )socket (AF_INET , SOCK_STREAM , 0 )) == (sock_T )- 1 )
@@ -332,17 +320,6 @@ netbeans_connect(char *params, int doabort)
332320 goto theend ;
333321 }
334322 memcpy ((char * )& server .sin_addr , host -> h_addr , host -> h_length );
335- #else
336- if ((sd = socket (AF_UNIX , SOCK_STREAM , 0 )) == -1 )
337- {
338- nbdebug (("error in socket() in netbeans_connect()\n" ));
339- PERROR ("socket() in netbeans_connect()" );
340- goto theend ;
341- }
342-
343- server .sun_family = AF_UNIX ;
344- strcpy (server .sun_path , address );
345- #endif
346323 /* Connect to server */
347324 if (connect (sd , (struct sockaddr * )& server , sizeof (server )))
348325 {
@@ -351,23 +328,13 @@ netbeans_connect(char *params, int doabort)
351328 if (errno == ECONNREFUSED )
352329 {
353330 sock_close (sd );
354- #ifdef INET_SOCKETS
355331 if ((sd = (sock_T )socket (AF_INET , SOCK_STREAM , 0 )) == (sock_T )- 1 )
356332 {
357333 SOCK_ERRNO ;
358334 nbdebug (("socket()#2 in netbeans_connect()\n" ));
359335 PERROR ("socket()#2 in netbeans_connect()" );
360336 goto theend ;
361337 }
362- #else
363- if ((sd = socket (AF_UNIX , SOCK_STREAM , 0 )) == -1 )
364- {
365- SOCK_ERRNO ;
366- nbdebug (("socket()#2 in netbeans_connect()\n" ));
367- PERROR ("socket()#2 in netbeans_connect()" );
368- goto theend ;
369- }
370- #endif
371338 if (connect (sd , (struct sockaddr * )& server , sizeof (server )))
372339 {
373340 int retries = 36 ;
0 commit comments