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 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 want to create a new net.tcp://localhost:x/Service endpoint for a WCF service call, with
New to Linux programming in general. I am trying to communicate with a kernel
I am relatively new to socket programming so this may sound like a very
I'm new to Python (I have been programming in Java for multiple years now
I'm pretty new to web programming and I'm currently developing a web back end
This topic resembles this thread I'm rather new to the topic of network programming,
Firstly, I'm relatively new to network programming. I want to intercept and delay HTTP
I'm designing a new protocol called DITP. It is a connection oriented protocol that
I'm programming a C/C++ client/server sockets application. At this point, the client connects itselfs
New class is a subclass of the original object It needs to be php4

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.