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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:36:37+00:00 2026-06-13T19:36:37+00:00

Yes, no? How can I achieve something like this: In Client side loop do

  • 0

Yes, no?

How can I achieve something like this:

In Client side

loop do
    socket.read(MAX_LEN)
    socket.pause_read   # the client is busy, do not send any more data, similar to: C system call shutdown(sock, SHUT_RD)
    # ... working

    socket.resume_read  # the client is ready to work again. 
end

In Server side

loop do
    rd, wr, _ = select(rdsockets, wrsockets)
    # wr is an array fill of clients ready to work
    wr.each {}
end

PS: Help can be provided either with C or Ruby.
Thank you in advance.

EDIT:
The incoming data has a predefined format and the length of the incoming data varies.

EDIT2:
OS: Linux

  • 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-13T19:36:38+00:00Added an answer on June 13, 2026 at 7:36 pm

    That’s how it already works if you don’t do anything. The “do work” will take some time, so the client won’t call read again until it finishes. The server will keep sending data for a little while, until the client’s receive buffer (part of the system TCP implementation) fills up; then the server will be throttled and select won’t return that client as writable anymore. The overall effect is that for a long-lived connection, the server will only send data as fast as the client can process it.

    If you need fine-grained control over the size of the receive buffer on the client, you can use setsockopt(SO_RCVBUF, size).

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

Sidebar

Related Questions

I would like to achieve something I can easily do in .net. What I
I can't find a straightforward yes or no answer to this! I know I
Yes, I know that downcast using dynamic_cast can't compile if the Base is not
How can I achieve this? A user clicks the delete link (with a class
I'm experiencing something considered a bug in my situation. Probably this is not a
I'm trying to achieve something similar to user of this post: Xcode/iOS: How to
can I use .net framework 4.0 in VS2008 ? If yes how can I
I have to encrypt/decrypt some sensitive information in a Xml file? Yes I can
yes what returned can be formatted using HH to display value in 24hrs, but
(Yes I know I can call Java code from Scala; but that is pointless;

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.