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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:17:18+00:00 2026-05-13T21:17:18+00:00

I am new to TCP programming so here is a few simple questions: Client

  • 0

I am new to TCP programming so here is a few simple questions:

  1. Client app is calling a listener.
    I am opening a connection with TcpClient:

    TcpClient myTcp = new TcpClient("Server", 1000);
    myTcp.connect();
    

    For how long will myTcp hold a connection? Is there any default value? Can I change it?

  2. If my calling application has a multiple threads (it’s a WCF service), each of threads has to call a listener. Can I create myTcp as a singleton and reuse it in multiple threads?

  3. If question 2 yes, how many simultaneous connections can myTcp handle?

  4. With singleton approach is there a chance to have synchronization issue between calls and responses?

  • 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-13T21:17:19+00:00Added an answer on May 13, 2026 at 9:17 pm

    As far as the server goes, if it’s a WCF service then WCF will take care of the threading concerns for you. You have a fair bit of control over the threading behavior of the service. But I suspect that’s not what you’re asking about.

    On the client, technically you can access a TcpClient or Socket from multiple threads but you cannot read or write to it concurrently so for all intents and purposes, no don’t try to share a TcpClient across threads unless you are very familiar with synchronization locks.

    But why are you using a TcpClient to talk to a WCF service? Why not use the WCF client channels to access it?

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

Sidebar

Related Questions

I'm a new user to C programming. I've tried researching this online, but couldn't
I use a tcp socket in the following way: m_socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
I am writing on a small tcp chat server, but I am encountering some
I'm working on a library that is currently using standard tcp sockets. An end
I have a net.tcp WCF service, and I would like the OS to pick
I have a WebService that I am trying to use NetTCPBinding on. here is
If a TCP socket server listens on port 28081 for incoming connections and then
Is there a distributed application framework (commercial is okay as well) that supports iPhone
I am trying to improve the performance of a Silverlight 4 WCF RIA application.
I have recently written a socket server in PHP that will be handling communication

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.