Skip to main content
deleted 114 characters in body; edited tags; added 1 characters in body
Source Link
dtb
  • 217.8k
  • 37
  • 413
  • 438

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 myTcp will hold a connection, is there any default value, can i change it?

  2. If my calling application has a multiple treads, its a WCF service, each of treads has to call a listener, can i create myTcp as a singleton and reuse it in multiple treads?

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

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

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

Client applicationFor how long will be installed on Windows Server 2008. Host application Windows Server 2008 as well.myTcp hold a connection? Is there any default value? Can I change it?

Thank you!

  1. 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?

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

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

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 myTcp will hold a connection, is there any default value, can i change it?

  2. If my calling application has a multiple treads, its a WCF service, each of treads has to call a listener, can i create myTcp as a singleton and reuse it in multiple treads?

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

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

Client application will be installed on Windows Server 2008. Host application Windows Server 2008 as well.

Thank you!

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?

  1. 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?

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

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

Source Link

C# TcpClient connection and multiple threads.

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 myTcp will hold a connection, is there any default value, can i change it?

  2. If my calling application has a multiple treads, its a WCF service, each of treads has to call a listener, can i create myTcp as a singleton and reuse it in multiple treads?

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

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

Client application will be installed on Windows Server 2008. Host application Windows Server 2008 as well.

Thank you!