Solved

TCP/IP question

Posted on 1998-06-30
1
151 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
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 Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

827 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