Re: Solved >Re: Trouble making more than 244 simultaneous connections
Re: Solved >Re: Trouble making more than 244 simultaneous connections
- Subject: Re: Solved >Re: Trouble making more than 244 simultaneous connections
- From: Jens Alfke <email@hidden>
- Date: Wed, 26 Nov 2008 14:49:16 -0800
On Nov 26, 2008, at 12:24 PM, Brian Williams wrote:
It was indeed the ulimit problem. I can now make the 1000
connections that I wanted.
Finding out where to set the limit took some digging, but eventually
I found out that you can set it in /etc/launchd.conf by adding
"limit maxfiles 2048 unlimited" where 2048 is per-process and
unlimited is system wide.
Ouch. You don't need to edit system-wide config files (or affect every
process on the system) to accomplish this. Just run "limit maxfiles
2048" in the parent process that launches your server. You can do this
by writing a tiny shellscript containing just that command followed by
an invocation of your server's executable file.
I think that I am going to try changing my code over to smallSockts
as the CF stuff i am using now seems to be dropping messages in my
tests. I could be that my test are wrong, but I'll see if
smallSockets is better.
No offense, but your tests are probably wrong. I've written a lot of
reliable TCP code using CFNetwork, not to mention the fact that
Safari's networking all goes through it.
Depending on exactly what API you're using, some of the callbacks can
bite you if you don't use them quite right. One thing to keep in mind
is that when data is available to read, or there's room to write data,
you'll only get one callback telling you so. You won't get any more
until you actually read/write some bytes. That may seem obvious but
it's easy to make mistakes in your flow of control that can break
this, leading your code to stop getting events.
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden