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. raw socket in Windows XP

raw socket in Windows XP

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
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.
  • Y Offline
    Y Offline
    yanping wang
    wrote on last edited by
    #1

    I created a row socket in order to send raw TCP data using following code: SOCKET sRaw = socket(AF_INET,SOCK_RAW,IPPROTO_IP); int flag = 1; setsockopt(sRaw, IPPROTO_IP, IP_HDRINCL, (char*)&flag, sizeo(flag)); after i intialized buffer and dest address, i call sendto function send it: int nRet = ::sendto(sRaw, buff, sizeof(ipHeader) + sizeof(tcpHeader), 0, (sockaddr*)&in, sizeof(in)); if(nRet == SOCKET_ERROR) { printf(" sendto failed () %d \n", ::GetLastError()); return; } the result is sendto failed with error code : 10004. Why? help me, tell me why, how can i send raw TCP data using raw socket. my OS is Windows xp sp2.

    E 1 Reply Last reply
    0
    • Y yanping wang

      I created a row socket in order to send raw TCP data using following code: SOCKET sRaw = socket(AF_INET,SOCK_RAW,IPPROTO_IP); int flag = 1; setsockopt(sRaw, IPPROTO_IP, IP_HDRINCL, (char*)&flag, sizeo(flag)); after i intialized buffer and dest address, i call sendto function send it: int nRet = ::sendto(sRaw, buff, sizeof(ipHeader) + sizeof(tcpHeader), 0, (sockaddr*)&in, sizeof(in)); if(nRet == SOCKET_ERROR) { printf(" sendto failed () %d \n", ::GetLastError()); return; } the result is sendto failed with error code : 10004. Why? help me, tell me why, how can i send raw TCP data using raw socket. my OS is Windows xp sp2.

      E Offline
      E Offline
      eagleboy
      wrote on last edited by
      #2

      Microsoft have crippled the TCP implementation in SP2. Google groups is your friend. Aaron.

      Y 1 Reply Last reply
      0
      • E eagleboy

        Microsoft have crippled the TCP implementation in SP2. Google groups is your friend. Aaron.

        Y Offline
        Y Offline
        yanping wang
        wrote on last edited by
        #3

        thank you very much. does TCP implementation exist in SP1?

        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