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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Socket Programming using threads

Socket Programming using threads

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminquestion
5 Posts 4 Posters 1 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
    Ajoy
    wrote on last edited by
    #1

    Scenario :- I want to connect to multiple servers from a single client at a time and collect some information. Is it possible to do this using CAsyncSocket in a single thread for each server? When is CAsynSocket used instead of CSocket ? Thanks in Advance, Ajoy. U Live And Let Others Live :)

    S B 2 Replies Last reply
    0
    • A Ajoy

      Scenario :- I want to connect to multiple servers from a single client at a time and collect some information. Is it possible to do this using CAsyncSocket in a single thread for each server? When is CAsynSocket used instead of CSocket ? Thanks in Advance, Ajoy. U Live And Let Others Live :)

      S Offline
      S Offline
      Sujan Christo
      wrote on last edited by
      #2

      Hi, Be carefull with multithreading, CLOSING, I've experinced the pain.PLAN PROPERLY. Sujan

      1 Reply Last reply
      0
      • A Ajoy

        Scenario :- I want to connect to multiple servers from a single client at a time and collect some information. Is it possible to do this using CAsyncSocket in a single thread for each server? When is CAsynSocket used instead of CSocket ? Thanks in Advance, Ajoy. U Live And Let Others Live :)

        B Offline
        B Offline
        Bob Stanneveld
        wrote on last edited by
        #3

        Hello, MSDN says the following about CSocket and CASyncSocket: "You should probably consider using CAsyncSocket if you want Windows Sockets' ease of dealing with multiple network protocols in an MFC application but do not want to sacrifice flexibility. You might also feel that you can get better efficiency by programming the communications more directly yourself than you could using the more general alternative model of class CSocket." So CSocket is a more easy to use class at the cost of some overhead. If you don't need high speed connections, multi network protocols, I'd stick with CSocket. Hope this helps :-D Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.

        V 1 Reply Last reply
        0
        • B Bob Stanneveld

          Hello, MSDN says the following about CSocket and CASyncSocket: "You should probably consider using CAsyncSocket if you want Windows Sockets' ease of dealing with multiple network protocols in an MFC application but do not want to sacrifice flexibility. You might also feel that you can get better efficiency by programming the communications more directly yourself than you could using the more general alternative model of class CSocket." So CSocket is a more easy to use class at the cost of some overhead. If you don't need high speed connections, multi network protocols, I'd stick with CSocket. Hope this helps :-D Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.

          V Offline
          V Offline
          vcplusplus
          wrote on last edited by
          #4

          I have heard that there are problems with CSocket. Check out this article. http://tangentsoft.net/wskfaq/articles/csocket.html[^]

          B 1 Reply Last reply
          0
          • V vcplusplus

            I have heard that there are problems with CSocket. Check out this article. http://tangentsoft.net/wskfaq/articles/csocket.html[^]

            B Offline
            B Offline
            Bob Stanneveld
            wrote on last edited by
            #5

            I didn't knew that.. Als an alternative, you can use a Socket class found here on codeproject. There are many here, so it should be easy to find one. Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.

            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