Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. TCp client Question

TCp client Question

Scheduled Pinned Locked Moved C#
sysadminhelpquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vl_t
    wrote on last edited by
    #1

    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.

    Z E E 3 Replies Last reply
    0
    • V vl_t

      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.

      Z Offline
      Z Offline
      Zoltan Balazs
      wrote on last edited by
      #2

      I don't know about TcpClient class but the Socket class has asynchronous method calls like BeginSend, BeginAccept, etc.

      1 Reply Last reply
      0
      • V vl_t

        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.

        E Offline
        E Offline
        Ennis Ray Lynch Jr
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • V vl_t

          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.

          E Offline
          E Offline
          engsrini
          wrote on last edited by
          #4

          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)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups