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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:45:48+00:00 2026-05-27T16:45:48+00:00

Socket.Disconnect(bool reuse) according to MSDN enables the program to reuse the socket. My questions

  • 0

Socket.Disconnect(bool reuse) according to MSDN enables the program to reuse the socket. My questions are:

  1. If we decide to reuse the socket does that mean it will reuse the same local end point as well? Would it preserve the port for that socket or would it just (I don’t believe it does) save all the objects resources?

  2. If in effect it does only save the resources would they be allocated to the next connection and if so do the send/receive buffers automaticly flush or is there some way the flush them? Does Socket.ShutDown(ShutDown.Both) do that for me on disconnect?

  3. In what situation would I use Socket.Disconnect(false)? If all the purpose is to reuse the socket what would this grant me?

  • 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-27T16:45:49+00:00Added an answer on May 27, 2026 at 4:45 pm
    1. If reuse = false the socket will be disposed automatically after closing. All settings as EndPoint and Buffer sizes are not reseted to defaults, but you can change it if you desire. Supose the user decides to change the connection port. You just need to close the socket, change the port and connect the socket again without create a new socket and set it up again.

    2. The Socket.Shutdown just disables send/receive/both; not disconnect the socket. However this occurs for new incoming/outgoing data so buffers will be flushed normaly. It is a good practice to call it before disconnection to ensure all data was sent and no data is being received while disconnecting.

    3. Returning to the example of 1. Supose you need to change only the port. You dont want to create the socket again, configure all parameters of the socket as events and buffers again, etc. It consumes time and resources, so it is better to reuse the socket you already have.

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

Sidebar

Related Questions

How should I disconnect a stream socket from server so that I will be
When the socket disconnect event is fired with socket.io (node.js), for how long will
Socket has a constructor that takes a winsock SOCKET as parameter and stores it
There is a socket related function call in my code, that function is from
When creating a Socket in Java: new Socket(host, port); The Socket constructor will try
I am using node.js socket.io-client and socket.io . I have a javascript program which
I am looking to do socket communications (listen, accept, connect, recv, send, disconnect) in
I have a class that encapsulates tcp socket communications with a server. For each
I'm making a program that retrieves decently large amounts of data through a python
I'm building a program that has a very basic premise. For X amount of

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.