Results 1 to 5 of 5

Thread: Socket in C for beginners

Hybrid View

  1. #1
    Just burned his ISO
    Join Date
    Jan 2010
    Posts
    3

    Default Socket in C for beginners

    Hi all.

    I would like to create a topic for beginners ( iam one of them) in socket and RAW socket programming in C.Where they can post all theire questions about this 2 subjects.

    Before starting i would like to know if iam in the good place for this kind of subject.I know other programming's forum, but sometimes about security programming peoples don't answer you as they could, cause they are suspicious of bad asking motivations.

    My goal is to make a kind of summary of all begginers questions and tips about socket and RAW socket.

    I think no question are stupid or useless, but some of them can with some search find her answer.
    So question like : "why when i compile my app on windows i got this kind of error : undefined reference to `_WSAStartup", no take place in this topic.

    Well that's all for the moment, hope this topic will be usefull for all begginers around and for me too.

    Cya.

    PS: sorry in advance for my quiet bad english.

  2. #2
    Very good friend of the forum Gitsnik's Avatar
    Join Date
    Jan 2010
    Location
    The Crystal Wind
    Posts
    851

    Default

    Go read beej's guide to network programming, it covers sockets (but not so much SOCK_RAW stuff, which is good to begin with). If you can't get the basics out of that (it covers some windows programming as well), then you need to stop. Link here.

    I highly recommend you don't start your work on windows. It doesn't follow most of the standards for socket coding (though there is a caveat - you can code most *nix sockets into it just fine with a few macros). Definitely run up a copy of BT or some other Linux (I usually dev on a debian etch box) and go from there.
    Still not underestimating the power...

    There is no such thing as bad information - There is truth in the data, so you sift it all, even the crap stuff.

  3. #3
    Just burned his ISO
    Join Date
    Jan 2010
    Posts
    3

    Default

    Yeah i know beej's guide, and for RAw socket i look this link since very few time :
    mixter.void.ru/rawip.

    (sry i can't post url for now)

    Then i got Ubuntu installed on my laptop.But that's true that most of time i work on windows only cause i got good chair , and a coffepot near to my desk xD

    But generally when i learn something i start working on windows, and when i understand weel, i start a most bigger dev project on Linux.When undertsanding globaly the thing, passing one to antother isn't so hard.

  4. #4
    Just burned his ISO
    Join Date
    Jan 2010
    Posts
    3

    Default

    Damn Gitsnik i got right now a concret exemple of what u said about using linux systeme and not windows.

    I just made a simple client/server RAw socket programme, wich just send a string one to other.

    And when i try to change ip client to "1.2.3.4", or another private ip of my local network.
    I got the error 10004 : A blocking operation was interrupted by a call to WSACancelBlockingCall.

    It seem that since XP Sp2 , windows disable some socket 's part.But how can bypass this error ? I heard that re-build the prog using libcap work.

    Btw i will try using the client side on a linux systeme soon.

  5. #5
    Just burned his ISO
    Join Date
    Jan 2010
    Posts
    11

    Default

    I second just using Beej's Guides. They really helped me when I was starting out with sockets..and I still use them as a reference.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •