Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 261647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:26:58+00:00 2026-05-11T22:26:58+00:00

I am writting a test program for a server. At the test app, I

  • 0

I am writting a test program for a server. At the test app, I try to connect a great number of clients to the server, but after a while a get all kind of errors like these :

Connection reset by peer: socket write error                   

or

java.net.SocketException: Connection reset                     

or

java.net.ConnectException: Connection refused: connect

I use a new socket for every client I connect to the server.

Could someone enlighten me about this strange behaviour?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T22:26:58+00:00Added an answer on May 11, 2026 at 10:26 pm

    Unfortunately you haven’t provided much details of your server’s nature. I suppose you are writing a typical TCP server. In this answer I will not talk about any Java-specific details.

    The short advice is: insert a delay between clients connections. Without it you are actively simulating a DoS attack to your server.

    For the longer one, read below.

    Usually a TCP server creates only 1 listening socked by calling (in lovely C interface) int sockfd = socket(...) function, and passing the result (sockfd in our case) to bind() and listen() functions. After this preparations, the server would call an accept() which will steep the server in slumber (if the socket was marked as blocking) and if a client on the other side of the Earth will start calling a connect() function, than accept() (on the server side) with the support of the OS kernel will create the connected socket.

    The actual number of possible pending connectins can be known by looking at the listen() function. listen() has a backlog parameter which defines the maximum number of connection the OS kernel should queue to the socket (this is basically a sum of all connections in SYN_RCVD and ESTABLISHED states). Historically the recommended value for backlog in 1980s was something like 5 which is obviously miserable in our days. In FreeBSD 7.2, for example, a hard limit for backlog may be guessed by typing:

    % sysctl kern.ipc.somaxconn
    kern.ipc.somaxconn: 128
    

    and in Fedora 10:

    % cat /proc/sys/net/core/somaxconn
    128
    

    P.S.
    Sorry for my terrible English.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 212k
  • Answers 212k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Looks like there is no .Net version for CGAL. May 12, 2026 at 10:26 pm
  • Editorial Team
    Editorial Team added an answer The following article will tell you how to set the… May 12, 2026 at 10:26 pm
  • Editorial Team
    Editorial Team added an answer You can just loop through it: for(var i = 0;… May 12, 2026 at 10:26 pm

Related Questions

I am using selenium RC to cycle through a long list of URLs, sequentially
What would be the best way to handle lightweight crash recovery for my program?
I am wondering why I'm not able to allocate more that 1,000 MB of
I am writing a test program with Ruby and ActiveRecord, and it reads a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.