Solved

TCP/IP question

Posted on 1998-06-30
1
152 Views
Last Modified: 2013-12-03
I'm building a  program that will sit on multiple computers and
function boh as client and server on each one. it's purpuse to send and receive files. The question is:
If the program on Computer A sends a file to computer B using port n, can it accept connection from Computer B
using the same port n?
0
Comment
Question by:MikeP090797
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 32

Accepted Solution

by:
jhance earned 50 total points
ID: 1408995
Yes, the port is only "consumed" on the receiving end and even then, you can have more than one connection on a given port.  As you call the listen() function on the receiver, it will hang until a connection comes in.  Then you call accept() to complete the connection.  If you process the data in a thread, your main loop can go back and keep listening and accepting more incoming connections.  The use of the port is limited to having one listener program on a given port.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What .NET website keeps me current? 9 80
How to LOAD up a .NET Framework website with data? 2 59
Authentication of Web Services 3 98
C# LINQ ForEach() question 6 88
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question