Class DInetSocketAddress

Inherits from:
Object
Conforms to:
DSocketAddressable
Declared in:
DSocketAddress.h

Class Hierarchy

    Object
      |
      +---DInetSocketAddress

Class Description

The DInetSocketAddress class implements a number of methods for using inet socket addresses.

Example:
#include <stdio.h>
#include "ofc/DSocketAddress.h"

int main(int argc, char *argv[])
{
  DInetSocketAddress *addr1 = [DInetSocketAddress new];
  unsigned char       b1,b2,b3,b4;

  [addr1 host :"localhost" :27];       // Set the host of the inet address

  printf("Family of address1: %d\n", [addr1 family]); // Print the family of the address
  printf("Port of address1: %d\n",   [addr1 port  ]); // Print the port of the address

  [addr1 get :&b1 :&b2 :&b3 :&b4];
  printf("Inet of address1: %d.%d.%d.%d \n", b1, b2, b3, b4); // Print the inet of the address

  [addr1 free];

  return 0;
}
Last modified:
11-Aug-2008 (DSocketAddress.h)

Instance Variables

private struct sockaddr _address
the socket address
private struct sockaddr_in *_inet
the cast to inet socket address
private int _error
the last error (for host method)

Method Index


generated 06-Sep-2008 by ObjcDoc 3.0.0