C++ Sockets for *nix and Win Platforms
Results 1 to 4 of 4

Thread: C++ Sockets for *nix and Win Platforms

  1. #1
    () \/V |\| 3 |) |3\/ |\|3G47|\/3
    Join Date
    Sep 2002
    Posts
    744

    C++ Sockets for *nix and Win Platforms

    Hey all, I was trying to do some sockets programming and found what I think is a really cool site. I've already found it extremely helpful and thought I'd pass it along.

    Practical C++ Sockets provides wrapper classes for a subset of the Berkeley C Socket API for TCP and UDP sockets. It should work on both the Unix (tested under Linux, RedHat 7.3 with gcc) and Windows (tested under Win2K with Visual C++ 6.0) platforms. The purpose of this project was to develop a very simple C++ interface to sockets. In writing the code, we often chose clarity over efficiency.
    Practical C++ Sockets

    Go Finland!
    Deviant Gallery

  2. #2
    Senior Member tampabay420's Avatar
    Join Date
    Aug 2002
    Posts
    953
    yet again, another completely useful and informative link from mathgirl32

    thanx a lot, you always seem to be interested/working on the most interesting things (1st the assembly stuff you posted now the sockets, maybe some math) - way cool... thanx again

    -take it easy?
    for windows coders, i saw this bit of info in that .h Documentation...
    static void cleanUp() throw(SocketException)
    If WinSock, unload the WinSock DLLs; otherwise do nothing. We ignore this in our sample client code but include it in the library for completeness. If you are running on Windows and you are concerned about DLL resource consumption, call this after you are done with all Socket instances. If you execute this on Windows while some instance of Socket exists, you are toast. For portability of client code, this is an empty function on non-Windows platforms so you can always include it.

    Throws:
    SocketException thrown WinSock clean up fails
    Parameters:
    buffer - buffer to receive the data
    bufferLen - maximum number of bytes to read into buffer
    Returns:
    number of bytes read, 0 for EOF, and -1 for error
    yeah, I\'m gonna need that by friday...

  3. #3
    () \/V |\| 3 |) |3\/ |\|3G47|\/3
    Join Date
    Sep 2002
    Posts
    744
    I'm so glad you guys liked it!

    None of my c++ books cover socket programming. I had been using MS Visual help and msdn, neither of which was very helpful and I wasn't getting any good returns on my google searches until like the third time I tried. That's when I found this site. It had very straight forward documentation and heavy commenting which was exactly what I needed. Anyway, it's cool stuff and I'm glad you guys found it useful, too.

    Go Finland!
    Deviant Gallery

  4. #4
    Senior Member tampabay420's Avatar
    Join Date
    Aug 2002
    Posts
    953
    \x74\x68\x69\x73\x20\x69\x73\x20
    \x66\x6F\x72\x20\x6D\x61\x74\x68
    \x67\x69\x72\x6C\x33\x32\xD\xA
    \x69\x20\x6D\x61\x64\x65\x20\x74
    \x68\x65\x73\x65\x20\x61\x76\x61
    \x74\x61\x72\x73\x20\x66\x6F\x72
    \x20\x68\x65\x72\x20\x3B\x29

    [edit]duh, that was dumb of me- i used the wrong slashes... [/edit]
    yeah, I\'m gonna need that by friday...

Posting Permissions

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