This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Q: problem "maximum number of clients reached"


Hi list,
I'm new here, and encountered the same proplems described below,
but, there is a much better way to overcome this problem:

Don't recompile ! but update the max. file descriptors of you process.
The _SC_OPEN_MAX if obtained from unix syscall "sysconf()" and will
return the max open files possible in the current process context.
Knowing this, we can easily increase this in the bash shell by typing:

# ulimit -a  (see all current limits)
# ulimit -n 128 ( increase open files to 128 )

I added this in the following startx script, which I use to start
the X server (see script below):

Note, the broadcast IP address is used to get a XDCMP chooser list
from a host on the same network, because the cygwin Xserver
can't generate this list by itself..... (maybe in a new release ?)

Hopefully this will help ! (it did for me)

regards,

-- Jerome Anten.


--------------------------------------------
#!/usr/bin/bash
#
# Start Xserver 

# Increase open file limit
ulimit -n 128

# Get local IP number
IP=`ipconfig |grep "IP Addr" | awk 'BEGIN {FS=":"} { print $2 }'`

# Get broadcast address
IPB1=`echo $IP | cut -d. -f1-3`
IPB=`echo $IPB1.255`

# Default command
cmd="Xwin -screen 0 1024x768x32 +bs -wm -whitepixel 255 -blackpixel 0 -engine 4
-once -from $IP "

if [ "x$1" == "x" ]; then
echo -n  "Give remote host to connect to ([Retrun] = broadcast mode) : "
read rhost

  if [ "x$rhost" == "x" ]; then
	$cmd -indirect $IPB &
  else
	$cmd -query $rhost &
  fi
else
	$cmd -query $1 &
fi
 
----------------------------------------------------------------




On Tue, 5 Jun 2001, Heiko Nardmann wrote:

> I suddenly got the following message:
> 
> Xlib: connection to "sn-pc161.cubis.de:0.0" refused by server
> Xlib: Maximum number of clients reached
> 
> How can I increase the maximum number of clients?
> 
recompile the XServer :(

in programs/Xserver/os/connection.c put another line after 
    lastfdesc = sysconf(_SC_OPEN_MAX) - 1;   
with
    lastfdesc = 255;

I don't know if it's safe, but I had it running in a similar way 
for hours. 

Or better, ask on cygwin-ml why sysconf(_SC_OPEN_MAX) says
that only 26? open files are allowed and beg them to change this.
Once they have changed it, XWin should accept more connections without
recompiling. :)

bye
        ago

-- 
 Alexander.Gottwald@informatik.tu-chemnitz.de 
 http://www.gotti.org
 +49 3725 349 80 80


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]