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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:16:01+00:00 2026-05-27T16:16:01+00:00

If I wrote a server bound to a wildcard address ( INADDR_ANY ), how

  • 0

If I wrote a server bound to a wildcard address (INADDR_ANY), how to determine which IP address the client is connected to?

I tried the following code when the after a successful accept call, but it just returned 0.0.0.0.

inet_ntop(AF_INET, &server_address.sin_addr, s, sizeof(s));
  • 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-27T16:16:02+00:00Added an answer on May 27, 2026 at 4:16 pm

    As stated in How to determine IP used by client connecting to INADDR_ANY listener socket in C, use getsockname, which gives you the socket which the connection is bound to (on local level).

    This is for C, but is applicable for C++ to.

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

Sidebar

Related Questions

I wrote a server-client rmi application and I'm using MacOsX and Ubuntu laptops to
I wrote a makefile: all: server client server: server.o des.o sha1.o /usr/local/arm-2009q1/bin/arm-none-linux-gnueabi-gcc -o server
I wrote an XML RPC server in python and a simple Test Client for
I'm creating a networked server for a boggle-clone I wrote in python, which accepts
I wrote a server-client communication program and it worked well. Client module import java.io.*;
I wrote a small Server class which basically is a TcpListener wrapper and ThreadPool
Everything is in the question. I wrote an UDP server/client and I want to
I have wrote a server program that can handle multiple client by using fork().
I wrote c# client-server application, server is sending data using socket.send(byte[]) and receive using
I wrote a server programe which is planed to use in multi player game.

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.