[comp.windows.x] problems connecting to a remote server

phil@GOLDHILL.COM (05/18/89)

I'm running standard R3 on a Sun 3/60 (OS 4.0.1) and "xhost +" to
allow all known hosts access. I then rlogin to another machine
on our network (either a 386i (4.0.1) or another 3/60) and set
DISPLAY to point back to the server. 

When I try and run a standard demos, maze, for example, everthing works
fine. I can also run a simple hello world application that I
wrote and that works fine. 

When I try and run a more sophisticated application that used
the following libraries (X, Xt, Xaw, and Xmu) I'm unable to
connect to the display. By using dbx I've found that the XOpenDisplay
call is failing in a call to "socket" which in turn calls "connect".
The first call to "socket" in "gethostid" succeeds.

When I run this application on the same machine as the server everything
works fine.

Any suggesstions, comments? Thanks in advance.

Phil Stanhope
Gold Hill Computers
phil@goldhill.com

galvin-peter@cs.yale.edu (05/22/89)

We put the following change into lib/X/XConnDis.c to solve this
problem.  Unfortunately we then had to relink all of our clients for
it to take effect.  Alternately we found we could specify the host
number in the DISPLAY variable rather than the hostname and all the
programs would run correctly.


diff  -r1.1 XConnDis.c
192c192,197
<               hostinetaddr = inet_addr (displaybuf);
---
> /* Yale - HML - don't depend on this to fail with -1 if not a host number */
>               if ( ( *displaybuf >= '0') && (*displaybuf <= '9' ) )
>                       hostinetaddr = inet_addr (displaybuf);
>               else
>                       hostinetaddr = -1;
>


					      --Peter

------------------------------------------    --------------------------------
Peter Baer Galvin       		      (203)432-1254
Senior Systems Programmer, Yale Univ. C.S.    galvin-peter@cs.yale.edu
51 Prospect St, P.O.Box 2158, Yale Station    ucbvax!decvax!yale!galvin-peter
New Haven, Ct   06457			      galvin-peter@yalecs.bitnet