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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:11:04+00:00 2026-05-26T05:11:04+00:00

I have a few basic questions about sockets programming. I am trying to write

  • 0

I have a few basic questions about sockets programming. I am trying to write a program (in C, linux) in which several client processes connect to a server process and also the clients need to connect to themselves. Though the clients would reside on separate machines, them being on the same machine is also a case. These are my questions.

  1. Can two client processes communicate with each other on the separate port? In that case none of them listens to a port (like how the server does). They just connect to a port using a socket and talk to each other. Is that possible?

  2. If not, how can I make communication between the clients?

Any idea on this would be of help. Thanks.

  • 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-26T05:11:04+00:00Added an answer on May 26, 2026 at 5:11 am
    1. no, in TCP this is not possible. When establishing the connection in TCP, you are always connecting to listening port, so one of the clients must listen.

    2. one of the clients needs to open listening port, but which one? Use the server as an arbiter! Employ a protocol where server moderates:

      • server decides which client will open the port
      • that client opens the port, listens to it and sends its address (host:port) to the server
      • servers sends it to the other client
      • the other client can connect now!

    And if you were asking if two processes can listen on the same port on the same machine, then the answer is no. But using the above protocol you can avoid this situation.

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

Sidebar

Related Questions

I have a few basic questions about the Dispose Pattern in C#. In the
I have some basic questions about core data (which I am new to) and
I have a few more basic questions about Ruby on Rails. 1) When I
I have a few basic questions regarding the syntax and usage of properties in
There have been a few questions asked here about why you can't define static
I have a few questions about getters and setters for arrays. Suppose we have
I have a few questions I am working with visual basic and i am
I have few small basic problems : How to format : int i =
Few basic doubts I have: 1. Is primary key column automatically indexed? 2. What
I have a few model classes with basic one-to-many relationships. For example, a book

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.