Object
|
+---DInetSocketAddress
The DInetSocketAddress class implements a number of methods for using inet socket addresses.
#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;
}