Solved

TCP/IP question

Posted on 1998-06-30
1
153 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

707 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