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. Sockets

Sockets

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminhelptutorialquestion
3 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.
  • A Offline
    A Offline
    Adrian Metcalfe
    wrote on last edited by
    #1

    Help !!!! I am trying to get some data out of a piece of equipement via our network, using windows sockets. Does anybody have any code which shows very easily how to connect to a ip address + port and send and receive data from it. I have tried the examples from MSDN and it only gets as far as the Bind() then fails. Any ideas ? Adrian

    N M 2 Replies Last reply
    0
    • A Adrian Metcalfe

      Help !!!! I am trying to get some data out of a piece of equipement via our network, using windows sockets. Does anybody have any code which shows very easily how to connect to a ip address + port and send and receive data from it. I have tried the examples from MSDN and it only gets as far as the Bind() then fails. Any ideas ? Adrian

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      Hi I've put some source code below. It'snot complete... But it should give you a start Nish

      CSocket s;
      s.Create();
      s.Connect("127.0.0.1",25);
      CString buff;
      buff="helo buster\r\n";
      s.Send(buff,buff.GetLength());
      char rbuff[128];
      s.Receive(rbuff,64,0);
      buff=rbuff;
      s.Close();

      1 Reply Last reply
      0
      • A Adrian Metcalfe

        Help !!!! I am trying to get some data out of a piece of equipement via our network, using windows sockets. Does anybody have any code which shows very easily how to connect to a ip address + port and send and receive data from it. I have tried the examples from MSDN and it only gets as far as the Bind() then fails. Any ideas ? Adrian

        M Offline
        M Offline
        markkuk
        wrote on last edited by
        #3

        See the basic examples section of the Winsock Programmes's FAQ

        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