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 3234388
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:23:08+00:00 2026-05-17T17:23:08+00:00

i m writing simple application involving a server and many clients at time. i

  • 0

i m writing simple application involving a server and many clients at time. i have to use DataGramSocket. application is simple exchange of messages through console like in chatting. but both operations in.readLine() and ds.receive() are blocking and putting them in seperate threads didn’t help as blocking i/o will block the thread too. can any body tell me how can i do that without nio

  • 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-17T17:23:09+00:00Added an answer on May 17, 2026 at 5:23 pm

    If you have threads which are dedicated only to sending or receiving data over network, then thread blocking won’t be a problem, as only that dedicated thread will be blocked.

    Then, let’s consider impact of this solution on number of threads in your application:

    • If you have only few clients per server, then having 2 I/O threads per client isn’t a problem.
    • If you have lots of clients per server, then you should accept the fact that some of their requests will be processed not immediately but only then worker thread becomes available. You can try to spawn as much I/O threads as there are clients, but there are limitations on the number of threads single JVM instance can have. Exact numbers depend on the size of heap available to your JVM and whether your architecture is 32bit or 64bit, see here.

    If you interested in general task of handling lots of clients, here is the classic web paper on this question.

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

Sidebar

Related Questions

I'm writing a simple web application and have hit a stumbling block of sorts
I'm writing a simple client/server application and am having trouble getting the client to
I'm writing a simple OpenGL application that uses GLUT . I don't want to
I am considering writing a simple database application for my wife, but I'm hung
I am writing a simple Python web application that consists of several pages of
I am writing a fairly simple Django application where users can enter string queries.
Hey folks - I'm writing a pretty simple iPhone application. The data comes from
I am writing a fairly simple WPF desktop application and under build\configuration manager, release
I'm writing an application and I'm trying to tie simple AJAX functionality in. It
I'm writing an application which reads large arrays of floats and performs some simple

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.