Results 1 to 3 of 3

Thread: C++ sockets

  1. #1
    Junior Member
    Join Date
    Dec 2003
    Posts
    1

    C++ sockets

    Hi. I'm learning C++ (i'm using kdevelop and i'm making "console" programs to begin with). I was searching a good tutorial on how to use socket with C/C++. I found a couple of pre-made libraries but I don't want "pre-made" things, I want to understand how they works.
    Thanks

  2. #2
    Senior Member
    Join Date
    Nov 2003
    Location
    Washington State
    Posts
    120
    Heres some links:
    http://www.chris-lott.org/resources/cstyle/
    http://ibrado.com/sock-faq/
    http://www.comptechdoc.org/independe...working/guide/
    I dont have time to look through them, but maybe you can find something usefull.

  3. #3
    Senior Member registered user
    Join Date
    Mar 2003
    Posts
    555
    A similar post in the python NG turned out this tutorial.

    The BSD sockets API is exposed in perl/python/ruby. If you're familiar with any of these, a few throw-away experimental scripts might help you gain a quick understanding of the API.

    The C-level API requires a lot of casting if I recall correctly. The thing that really (once) helped me understand it all is that the BSD library was designed as a multi-protocol one, not just tcpip. So the structure which represents a generic network address is slightly expanded to accomodate the notion of a tcp address, and when passing pointers to these, one needs to explicitly cast in C. In C++ proper objects can represent those notions and offer a cleaner interface. You can implement such a wrapper yourself once you've understood the underlying C-level API.

Posting Permissions

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


IBM System X3850-X5 Server w/4x Intel  Xeon E7-4870 CPU , 512 GB DDR3 RAM,NO HDD picture

IBM System X3850-X5 Server w/4x Intel Xeon E7-4870 CPU , 512 GB DDR3 RAM,NO HDD

$1299.99



Unused IBM 09P0037 MAINBOARD For  RS/6000 7044-170 P-Series picture

Unused IBM 09P0037 MAINBOARD For RS/6000 7044-170 P-Series

$375.00



IBM QRadar xx29 2x Xeon E5-2650v4 2x 900W PSU M5120 12x 3.5

IBM QRadar xx29 2x Xeon E5-2650v4 2x 900W PSU M5120 12x 3.5" Bay Server No RAM

$179.99



Rare Vintage IBM 93ZZ PowerPC Server Board - MCM Ceramic CPU - 40N1844 - 1.1 lbs picture

Rare Vintage IBM 93ZZ PowerPC Server Board - MCM Ceramic CPU - 40N1844 - 1.1 lbs

$49.99



Compaq ProLiant 1500R 5/100 rack server, Series 3155, with IBM 2.1GB HD, VINTAGE picture

Compaq ProLiant 1500R 5/100 rack server, Series 3155, with IBM 2.1GB HD, VINTAGE

$295.00



IBM SYSTEM X3500 M3 SERVER 7380AC1 TOWER Server XEON E5620 8GB RAID SEE NOTES picture

IBM SYSTEM X3500 M3 SERVER 7380AC1 TOWER Server XEON E5620 8GB RAID SEE NOTES

$110.30



IBM 4262 SYSTEM x3200 Tower - HDD Wiped, NO OS picture

IBM 4262 SYSTEM x3200 Tower - HDD Wiped, NO OS

$80.00



IBM SYSTEM X3550 M5 5463AC1 2.5x8 Server 2*XEON E5-2640 V3 8GB SEE NOTES picture

IBM SYSTEM X3550 M5 5463AC1 2.5x8 Server 2*XEON E5-2640 V3 8GB SEE NOTES

$85.99



IBM ADP Server Type 7870 AC1 NO HDD | 128GB RAM PC3L | 2 x Xeon  E5620 picture

IBM ADP Server Type 7870 AC1 NO HDD | 128GB RAM PC3L | 2 x Xeon E5620

$199.99



IBM 7014-T00 Enterprise 19

IBM 7014-T00 Enterprise 19" Rack Enclosure No Keys

$549.95