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

  • SEARCH
  • Home
  • 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 433k
  • Answers 433k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It turns out using the postback was the way to… May 15, 2026 at 2:51 pm
  • Editorial Team
    Editorial Team added an answer Your code would be something like this: JQuery.Post("url", JQuery.Select("#testform").Serialize(), delegate(object… May 15, 2026 at 2:51 pm
  • Editorial Team
    Editorial Team added an answer You can safely call .asInstanceOf[AnyRef] on any Scala value, which… May 15, 2026 at 2:51 pm

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.