[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

TCP/IP question

Posted on 1998-06-30
1
Medium Priority
?
163 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 200 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

834 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