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 / C++ / MFC
  4. i want to send my char array of 1 MB through CSocket .. it Contains Sound data. How i typecast it or ,,,,,?

i want to send my char array of 1 MB through CSocket .. it Contains Sound data. How i typecast it or ,,,,,?

Scheduled Pinned Locked Moved C / C++ / MFC
questiondata-structures
2 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.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    I have a sound data in array of 1MB , how can i send it through CSocket class ... Is there any type ast needed.. if yes then how. will it loose data or not.. thanx

    D 1 Reply Last reply
    0
    • A Anonymous

      I have a sound data in array of 1MB , how can i send it through CSocket class ... Is there any type ast needed.. if yes then how. will it loose data or not.. thanx

      D Offline
      D Offline
      Dean Goodman
      wrote on last edited by
      #2

      Check out this link for a reference to the API. To answer your question, if you create the socket with the SOCK_STREAM flag, then the TCP will be used and you will not lose any data since TCP is a reliable transport. However, if you want a potential speed-up in send times (at the risk of losing data), create the socket with the SOCK_DGRAM flag to create a UDP connection. The Send function takes data in the form of a void* (see above link for further reference). --Dean

      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