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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:29:13+00:00 2026-05-24T06:29:13+00:00

I am working on a server/client based project. I almost finished my server side

  • 0

I am working on a server/client based project. I almost finished my server side code.

I develop the server app in EclipseCDT on Ubuntu Desktop, and everything just works fine.

But when deploy my app to a Ubuntu Server (I tried Server 10.04/10.10), the server app can start normally (waiting for connection), but the same client just cannot connect to the server.

I use Socket for receiving and sending data to/from the client.

Peter

P.S.: if I install sudo apt-get install ubuntu-desktop on my server machine, then everything works fine again.

===========================================================================

New Findings from the source code:

LabelStartBlocking:
int newScoketId = ::accept(socketId, 0, 0); // socketId == 3 ::accept is define in socket.h
                          // waiting for connection
LabelResume: // if new connection coming
// Do something with newSocketId

The behavior difference between Ubuntu Desktop and Server is:

On Ubuntu Desktop version, when the server starts, it is blocked at LabelStartBlocking with the socket routine ::accept; and then if a new connection arrives, the server will resume at LabelResume and create a new socket connection using the return value newSocketId;

However, on Ubuntu Server version, when the server starts, it is also blocked at LabelStartBlocking with the socket routine ::accept, but if a new connection arrives, the server won’t resume at LabelResume, and the new socket connection CANNOT be created.

Can you guys help me out?

Peter

  • 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-24T06:29:14+00:00Added an answer on May 24, 2026 at 6:29 am

    Thanks for your attention.

    I finally figured it out.

    If there are more than one IP addresses for the same hostname (/etc/hosts), the old code will fail.

    Example /etc/hosts file:

    127.0.0.1 localhost YourHostName
    10.50.10.251 YourHostName
    

    I traced the calling stack, and I found that, the IP address (10.50.10.251) passed to the program is translated into hostname, and then later the hostname is translated back to IP address (for binding), but a DIFFERENT one, that’s why my server program cannot accept any client connection.

    Hope it helps if any others have the similar issue.

    Peter

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

Sidebar

Related Questions

I'm working on a socket based client-server app. When a user running any iDevice
I'm working on this project where the client has a virtual server setup. I
I'm currently working on an emulation server for a flash-client based game, which has
I've been working on creating a SAAJ based client. Everything seemed to be working
I'm currently working on a project which needs some server-client communication. We're planning to
I desperately want to use server-side includes in a project I'm working on because
I'm currently working on a small client/server project that uses CORBA and I am
I am working on a client-server application that uses boost::serialization library for it's serialization
I'm working on a client-server Android application and trying to figure out how to
I'm working on a client/server library for a legacy RPC implementation and was running

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.