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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:09:38+00:00 2026-05-18T04:09:38+00:00

Recently I was designing a simple ftp. When a client connects to server, server

  • 0

Recently I was designing a simple ftp. When a client connects to server, server create a special Socket for this connection:

Socket clientSocket = listenSocket.accept();

I want to use this socket to send commands to server and create a new one to send data.
So I have two questions.

  1. Should I create a new socket for data only once, and remember reference, or create it whenever I need?
  2. How exactly can I Create it? On server side create a new Socket, and through clientSocket send a port number to client so it know which port it should use to send/receive data.

Appreciate Your advice!

  • 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-18T04:09:38+00:00Added an answer on May 18, 2026 at 4:09 am

    You might look at the FTP spec here: https://www.rfc-editor.org/rfc/rfc959 Specifically, check out page 3. You’ll see FTP has a passive data port which waits for connections in addition to the control connection. Also, there is a diagram on page 7 which clarifies the typical FTP approach. Replicating it would certainly be a viable strategy.

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

Sidebar

Related Questions

Recently I've been designing a Thread class library, I've made a Thread abstract class
Recently, I started changing some of our applications to support MS SQL Server as
Recently we got a new server at the office purely for testing purposes. It
I have recently been thinking about the difference between the two ways of defining
Recently Jeff has posted regarding his trouble with database deadlocks related to reading. Multiversion
Recently I have been investigating the possibilities of caching in ASP.NET. I rolled my
Recently, I've been dealing with an error with accessing MAPI via the .NET framework
Recently our site has been deluged with the resurgence of the Asprox botnet SQL
Recently I had to develop a SharePoint workflow, and I found the experience quite
Recently, I read an article entitled SATA vs. SCSI reliability . It mostly discusses

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.