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. Is it possible to send user data in CSocket::Connect

Is it possible to send user data in CSocket::Connect

Scheduled Pinned Locked Moved C / C++ / MFC
visual-studiosysadminquestion
8 Posts 6 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.
  • I Offline
    I Offline
    includeh10
    wrote on last edited by
    #1

    I hope client can send some secure data at connect time vs CSocket::Connect, so that server can read the data and knows it is my client connection, or server rejects the connection immediately. Is it possible to send user data vs CSocket::Connect?

    S B Z R M 5 Replies Last reply
    0
    • I includeh10

      I hope client can send some secure data at connect time vs CSocket::Connect, so that server can read the data and knows it is my client connection, or server rejects the connection immediately. Is it possible to send user data vs CSocket::Connect?

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      includeh10 wrote:

      Is it possible to send user data vs CSocket::Connect?

      Don't think so - I think authentication (for that's what you want) has to be done separately post-connect.

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      1 Reply Last reply
      0
      • I includeh10

        I hope client can send some secure data at connect time vs CSocket::Connect, so that server can read the data and knows it is my client connection, or server rejects the connection immediately. Is it possible to send user data vs CSocket::Connect?

        B Offline
        B Offline
        Bacon Ultimate Cheeseburger
        wrote on last edited by
        #3

        includeh10 wrote:

        I hope client can send some secure data at connect time vs CSocket::Connect

        In order to send and receive data during a connect operation you will need to use WSAConnect() rather than CSocket::Connect(). Keep in mind this is protocol dependent and is not supported by the TCP/IP stack.

        1300 calories of pure beef goodness can't be wrong!

        Z 1 Reply Last reply
        0
        • B Bacon Ultimate Cheeseburger

          includeh10 wrote:

          I hope client can send some secure data at connect time vs CSocket::Connect

          In order to send and receive data during a connect operation you will need to use WSAConnect() rather than CSocket::Connect(). Keep in mind this is protocol dependent and is not supported by the TCP/IP stack.

          1300 calories of pure beef goodness can't be wrong!

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

          Note Connect data is supported only on ATM (RAWWAN) over a raw socket. TCP/IP in Windows does not support connect data.

          it's my pleasure to make friend with you.

          B 1 Reply Last reply
          0
          • I includeh10

            I hope client can send some secure data at connect time vs CSocket::Connect, so that server can read the data and knows it is my client connection, or server rejects the connection immediately. Is it possible to send user data vs CSocket::Connect?

            Z Offline
            Z Offline
            zhu_lin
            wrote on last edited by
            #5

            from the msdn about WSAConnect: The lpCallerData parameter contains a pointer to any user data that is to be sent along with the connection request (called connect data). This is additional data, not in the normal network data stream, that is sent with network requests to establish a connection. This option is used by legacy protocols such as DECNet, OSI TP4, and others. Note Connect data is not supported by the TCP/IP protocol in Windows. Connect data is supported only on ATM (RAWWAN) over a raw socket.

            it's my pleasure to make friend with you.

            1 Reply Last reply
            0
            • Z zhu_lin

              Note Connect data is supported only on ATM (RAWWAN) over a raw socket. TCP/IP in Windows does not support connect data.

              it's my pleasure to make friend with you.

              B Offline
              B Offline
              Bacon Ultimate Cheeseburger
              wrote on last edited by
              #6

              zhu_lin wrote:

              Connect data is supported only on ATM (RAWWAN) over a raw socket

              Which would make it protocol dependent.

              zhu_lin wrote:

              TCP/IP in Windows does not support connect data.

              echo...echo...echo...

              1300 calories of pure beef goodness can't be wrong!

              1 Reply Last reply
              0
              • I includeh10

                I hope client can send some secure data at connect time vs CSocket::Connect, so that server can read the data and knows it is my client connection, or server rejects the connection immediately. Is it possible to send user data vs CSocket::Connect?

                R Offline
                R Offline
                Rajesh R Subramanian
                wrote on last edited by
                #7

                Hello, You cannot do such a thing. Any validation should be done after accepting the connection only.

                It is a crappy thing, but it's life -^ Carlo Pallini

                1 Reply Last reply
                0
                • I includeh10

                  I hope client can send some secure data at connect time vs CSocket::Connect, so that server can read the data and knows it is my client connection, or server rejects the connection immediately. Is it possible to send user data vs CSocket::Connect?

                  M Offline
                  M Offline
                  Moak
                  wrote on last edited by
                  #8

                  No, a TCP stream must connect before exchanging data.

                  My webchat in Europe :java: (in 4K)

                  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