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. winsock or CSocket

winsock or CSocket

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminc++jsonquestion
4 Posts 3 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.
  • Z Offline
    Z Offline
    zecodela
    wrote on last edited by
    #1

    hi all, i am trying to write a client to connect to a non-mfc application thro' network. i am just at the beginning, i found that CSocket approach only support connecting to mfc application as the CArchive used. is it true? would you recommend using winsock api or start from CSocket to connect to a non-mfc server? i don't have too much idea about these. pls try to give me some idea! thanks, jim

    G M 2 Replies Last reply
    0
    • Z zecodela

      hi all, i am trying to write a client to connect to a non-mfc application thro' network. i am just at the beginning, i found that CSocket approach only support connecting to mfc application as the CArchive used. is it true? would you recommend using winsock api or start from CSocket to connect to a non-mfc server? i don't have too much idea about these. pls try to give me some idea! thanks, jim

      G Offline
      G Offline
      Greven
      wrote on last edited by
      #2

      I'm actually going through a similar situation. And I can tell you that CSocket will not connect to a standard socket connection. If you use CSocket, you have to use CSocket throughout. If you can't use CSocket on all ends, use basic sockets. There's quite a bit of info out there. Programming in binary is as easy as 01 10 11.

      1 Reply Last reply
      0
      • Z zecodela

        hi all, i am trying to write a client to connect to a non-mfc application thro' network. i am just at the beginning, i found that CSocket approach only support connecting to mfc application as the CArchive used. is it true? would you recommend using winsock api or start from CSocket to connect to a non-mfc server? i don't have too much idea about these. pls try to give me some idea! thanks, jim

        M Offline
        M Offline
        Masaaki Onishi
        wrote on last edited by
        #3

        Hello, the codegurus around the world.;) As the previous poster pointed out, CSocket or CAsyncSocket class is closely related to GUI by MFC. So, if you don't need to use MFC, you don't need these classes at all. (In fact, WSAAsyncSelect function is inserted some messages like FD_WRITE to Window message process at CSocket and CAsynSocket) As a result, WinSock API is best choice for you. Please, don't send me your email about your questions directly. Have a nice day! Sonork - 100.10571:vcdeveloper ;)

        -Masaaki Onishi-

        Z 1 Reply Last reply
        0
        • M Masaaki Onishi

          Hello, the codegurus around the world.;) As the previous poster pointed out, CSocket or CAsyncSocket class is closely related to GUI by MFC. So, if you don't need to use MFC, you don't need these classes at all. (In fact, WSAAsyncSelect function is inserted some messages like FD_WRITE to Window message process at CSocket and CAsynSocket) As a result, WinSock API is best choice for you. Please, don't send me your email about your questions directly. Have a nice day! Sonork - 100.10571:vcdeveloper ;)

          -Masaaki Onishi-

          Z Offline
          Z Offline
          zecodela
          wrote on last edited by
          #4

          hi, i want to know whether i can use CSocket class to connect to non-mfc application. or, CSocket designed to be able for only connecting to MFC application. in my application, i used MFC GUI. but, what i mean is connecting to Non-MFC application but my application is a MFC application. i don't sure CSocket can connect to standard socket application such as a web server... currently, i am using a winsock API. but, i feel it is a bit trouble on receiving data using recv() function. thanks, jim

          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