TCp client Question
-
I am new to network programming. May be its a basic question, I surely can get help with ur input. I have a TCP Client class and when I have a message to send I initialize tcpclient, connect and send the message. Now I have a time out till i wait for response. I am waiting for response, My question is : Can I send another message while waiting for response. After I receive a response I close the tcpClient.It is a disconnected client.
-
I am new to network programming. May be its a basic question, I surely can get help with ur input. I have a TCP Client class and when I have a message to send I initialize tcpclient, connect and send the message. Now I have a time out till i wait for response. I am waiting for response, My question is : Can I send another message while waiting for response. After I receive a response I close the tcpClient.It is a disconnected client.
I don't know about TcpClient class but the Socket class has asynchronous method calls like BeginSend, BeginAccept, etc.
-
I am new to network programming. May be its a basic question, I surely can get help with ur input. I have a TCP Client class and when I have a message to send I initialize tcpclient, connect and send the message. Now I have a time out till i wait for response. I am waiting for response, My question is : Can I send another message while waiting for response. After I receive a response I close the tcpClient.It is a disconnected client.
TCP is a dual mode protocol and you can send while waiting on a response. You would have to use non-blocking code, however. (Asynchronous calls). Based on your scenario the ungaraunteed UDP may be an option to consider.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway -
I am new to network programming. May be its a basic question, I surely can get help with ur input. I have a TCP Client class and when I have a message to send I initialize tcpclient, connect and send the message. Now I have a time out till i wait for response. I am waiting for response, My question is : Can I send another message while waiting for response. After I receive a response I close the tcpClient.It is a disconnected client.
I think i understand what you r saying, you have to wait until u get the response for the command. If there is any request in between (during wait), you have send it right? For that you can use TCP asynchronous send/receive method, but u include a packet identifier eg. PACKET#1 as part of the message, on the receiver end the response should be made with this packet identifier. (like a handshake mechanism)