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. Asynchronous socket programming

Asynchronous socket programming

Scheduled Pinned Locked Moved C#
3 Posts 2 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.
  • F Offline
    F Offline
    Frozzeg
    wrote on last edited by
    #1

    at to fast message sending i get 1 incoming message with 10 grouped packets and not 1 packet for each of 10 incoming messages for p.s. sry for terrible english

    P 1 Reply Last reply
    0
    • F Frozzeg

      at to fast message sending i get 1 incoming message with 10 grouped packets and not 1 packet for each of 10 incoming messages for p.s. sry for terrible english

      P Offline
      P Offline
      Paulo Zemek
      wrote on last edited by
      #2

      I am not sure what the 1 message with 10 packets means... specially compared to 1 packet to 10 messages, but I think I have the "solution". For example: Send("Test1"); Send("Test2"); Send("Test3"); The client can receive: Test1Test2Test3 Or you can receive the message as: Test 1Tes t2Te st3 In fact, TCP/IP only "streams" data. If you expect to send "one packet" and receive "one packet" you are going the wrong way. Ahh... and that's has nothing to do with synchronous or asynchronous programming... it's the TCP/IP way of working. If you expect for messages, you must Receive the buffer, accumulate it to the last buffer (if it exists) and then search as many "begin/ends" as it is possible in the message, so it's up to you to do that.

      F 1 Reply Last reply
      0
      • P Paulo Zemek

        I am not sure what the 1 message with 10 packets means... specially compared to 1 packet to 10 messages, but I think I have the "solution". For example: Send("Test1"); Send("Test2"); Send("Test3"); The client can receive: Test1Test2Test3 Or you can receive the message as: Test 1Tes t2Te st3 In fact, TCP/IP only "streams" data. If you expect to send "one packet" and receive "one packet" you are going the wrong way. Ahh... and that's has nothing to do with synchronous or asynchronous programming... it's the TCP/IP way of working. If you expect for messages, you must Receive the buffer, accumulate it to the last buffer (if it exists) and then search as many "begin/ends" as it is possible in the message, so it's up to you to do that.

        F Offline
        F Offline
        Frozzeg
        wrote on last edited by
        #3

        ok, very helpful, thx!

        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