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

  • SEARCH
  • Home
  • 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 8845769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:48:45+00:00 2026-06-14T11:48:45+00:00

If I have a socket variable named ‘sock’ and lets say down the line

  • 0

If I have a socket variable named ‘sock’ and lets say down the line for some reason you have to create a new socket, lets say its called ‘sock2’, and you set ‘sock2’ to equal ‘sock’. And then you throw away the variable ‘sock’. Will the connection still work, will ‘sock2’ still be able to communicate with the other end of the socket that was originally in ‘sock’?

  • 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-06-14T11:48:47+00:00Added an answer on June 14, 2026 at 11:48 am

    Since there is still a reference to the object that was originally sock (in the form of sock2), the Java garbage collection will not dispose of it, and you can still use sock2 as if it were sock.

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

Sidebar

Related Questions

I don't have much experience with Javascript, Node.js or Socket.io. I'm trying to create
Is it possible to have the Bluetooth RFCOMM socket declared as a global variable,
I have some experience with socket programming using the Berkeley socket API in C.
The code I have is: class New(Server): noOfCl = 0 def onConnect(self, socket): print
I have a socket.io server listening for certain events on sockets. Whenever an event
I have c++ socket server and android client. Server constantly sends data to the
I have a socket application which I can use in local network, at home.
I have a socket server in php server.php $master = WebSocket(localhost,800); $sockets = array($master);
I have a socket feeding into a sax parser, formatted as a ISO 8859/1
in my android application I have a socket, but when I rotate the screen,

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.