aspose file tools
The moose likes Sockets and Internet Protocols and the fly likes How do i limit the number of socket connections... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "How do i limit the number of socket connections..." Watch "How do i limit the number of socket connections..." New topic
Author

How do i limit the number of socket connections...

Stoic Eustov
Greenhorn

Joined: Feb 13, 2002
Posts: 8
I have a file server that accepts connections, i would like to limit the number of connections to 45 users...
The �ServerSocket (int port, int backlog)�, does not work due to OS buffers...
Anybody know how to limit the number of connections, then free the connection upon user disconnect. Thx
Lewin Chan
Ranch Hand

Joined: Oct 10, 2001
Posts: 214
Why don't you make a threadpool of 45 request handlers, and just notify them when there is a new request.
I think the o'reilly book Java Network Programming has a pretty good example of doing this.


I have no java certifications. <br />This makes me a bad programmer.<br />Ignore my post.
 
 
subject: How do i limit the number of socket connections...
 
Threads others viewed
Can BEA 7.x be installed on windows XP home ?
Doubt in Connection Pooling
WAS 3.5 -> WAS 4.0
Swing-JTextArea
JDBC in JSP/Servlet question
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture