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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:43:23+00:00 2026-05-15T02:43:23+00:00

I have an application that runs on embedded linux (older kernel, 2.6.18). I’m using

  • 0

I have an application that runs on embedded linux (older kernel, 2.6.18). I’m using Live555. Occasionally when the camera is heavily loaded, my RTSP server (built using Live555) will hang indefinitely–no amount of connecting or cajoling seems to get it to snap out of it, short of resetting the application.

I narrowed the hang down to this code:

static int blockUntilReadable(UsageEnvironment& env,
                  int socket, struct timeval* timeout) {
  int result = -1;
  do {
    fd_set rd_set;
    FD_ZERO(&rd_set);
    if (socket < 0) break;
    FD_SET((unsigned) socket, &rd_set);
    const unsigned numFds = socket+1;

    result = select(numFds, &rd_set, NULL, NULL, timeout);  <--HANG

timeout is, of course, a NULL pointer which indicates it should block until one of the sockets is readable. Problem is: it doesn’t matter if I connect to the RTSP server–it simply blocks indefinitely.

I did a netstat -an, and it always outputs something like:

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:5222            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:5800            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:5000            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:5802            0.0.0.0:*               LISTEN
tcp       21      0 0.0.0.0:554             0.0.0.0:*               LISTEN

When it’s in a failed state, I always see 21 on the Recv-Q, which is “The count of bytes not copied by the user program connected to this socket.”

Does anyone have any idea what might be going south, or how I could troubleshoot this issue?

  • 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-15T02:43:24+00:00Added an answer on May 15, 2026 at 2:43 am

    That code looks pretty solid. I’m a little curious as to why you’re casting to unsigned int, but it shouldn’t hurt anything.

    Some thoughts:

    It’s not hanging where you think it is. Hopefully you’ve double/triple checked this. (Check it again?)

    Your netstat interpretation is wrong. That part, as the man page notes, is for “Established” sockets – yours is a listener, which is the next sentence: “Listening: Since Kernel 2.6.18 this column contains the current syn backlog.”

    That looks like a huge backlog… Which leads me to think you’re not accept()-ing, perhaps because you’re stuck in select(). That is the select() on your listening socket right?

    Last, double check that you’re calling select() on the right socket. ie, print out that socket arg, and see if it is what it should be.

    Essentially, verify: 1) it’s is hanging in select() and 2) the arguments to select are correct. I suspect one of those two are not true.

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

Sidebar

Ask A Question

Stats

  • Questions 403k
  • Answers 403k
  • 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 I guess there's really no single "best practice" for this… May 15, 2026 at 5:14 am
  • Editorial Team
    Editorial Team added an answer I believe DBD::CSV is a simple DBD implementation that uses… May 15, 2026 at 5:14 am
  • Editorial Team
    Editorial Team added an answer Actually had Mike Ash's implementation pointed out to me, and… May 15, 2026 at 5:14 am

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.