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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:49:47+00:00 2026-06-02T08:49:47+00:00

there. I am trying to program a server. The server receive some information from

  • 0

there.

I am trying to program a server.

The server receive some information from client

and it sends the information to the other server and it receive the response.

Do I need to use select() on this case?

or Pthread only is enough to do this.

my server has many clients connecting concurrently

please answer me kindly.

And if there is, please tell me the source code or site that I can refer to

  • 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-06-02T08:49:48+00:00Added an answer on June 2, 2026 at 8:49 am

    One approach to implementing a server that handles multiple clients is to create a pthread for each client connection, so that you can read/write each connection in a dedicated thread. It sounds like what you’re asking is “if I have a pthread for each client connection, do I still need to use select?”

    In a very simple server you might be able to dispense with select: the connection thread looks something like:

    do {
          read(conn, cmd);
          response = process(cmd);
          write(conn, response);
    } while (cmd != DONE)
    

    But, even with a dedicated client thread, you may find that you still want to use select to check for available input before calling read on the client connection. For example, if you need to be able to implement an idle timeout on your connection, you won’t want to just do a blocking read.

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

Sidebar

Related Questions

There is some code that I'm trying to convert from IList to IEnumerable :
There is a website I am trying to pull information from in Perl, however
I am trying to program an App that fetches files from a server. I
I am trying to write a basic client-server program to allow the client to
I am trying to create a simple voucher program. Client connects to server and
Hey there. I'm trying to write a small program that will read the four
Is there anything like boost::thread_group in C++11? I'm just trying to port my program
Hi there I'm trying to input 3 integers from the keyboard and print rows
I am trying to write server that will communicate with any standard client that
I'm a novice/beginner programmer having problems getting some simple client/server C code working. My

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.