- Inherits from:
- Object
- Conforms to:
- DSocketAddressable
- Declared in:
- DSocketAddress.h
Object
|
+---DUnixSocketAddress
Class Description
The DUnixSocketAddress class implements a number of methods for using
unix (file) socket addresses.
- Example:
#include <stdio.h>
#include "ofc/DSocketAddress.h"
int main(int argc, char *argv[])
{
#ifdef DSA_AF_UNIX
DUnixSocketAddress *addr2 = [DUnixSocketAddress alloc];
[addr2 init :"udp1"]; // Init with a filename
printf("Family of address2: %d\n", [addr2 family]); // Print the family of the unix address
[addr2 free];
#else
printf("UnixSocketAddress not present.\n");
#endif
return 0;
}
- Last modified:
- 11-Aug-2008 (DSocketAddress.h)
Instance Variables
- private struct sockaddr _address
- the address
- private struct sockaddr_un *_unix
- the unix cast to address
- private int _size
- the size of sockaddr
- private int _error
- always 0
- Constructors
- - (DUnixSocketAddress *) init
- Initialise the socket address
- Returns:
- the object
- - (DUnixSocketAddress *) init :(const char *) filename
- Initialise the socket address with a filename
- Parameters:
- filename - the name of the file
- Returns:
- the object
- Copy related methods
- - copy
- Copy the object (for protocol)
- Returns:
- the object
- - shallowCopy
- Do a shallow copyo of the object
- Returns:
- the object
- Deconstructor
- - free
- Free the address object
- Returns:
- the object
- Member services
- - (DUnixSocketAddress *) close
- Close the socket address
- Returns:
- the object
- - (int) error
- Return the last error
- Returns:
- the last error
- - (int) family
- Return the family of the socket address
- Returns:
- the family
- - (DText *) host
- Return the filename
- Returns:
- a (new) DText object with the filename (or nil for not found)
- - (int) port
- Return the port
- Returns:
- the port
- - (int) size
- Return the size of the socket address
- Returns:
- the size
- - (void *) sockaddr
- Return the socket address
- Returns:
- the socket address
- Socket address setters
- - (BOOL) filename :(const char *) name
- Set the filename for an unix socket
- Parameters:
- filename - the name of the file
port - the port for the socket
- Returns:
- success
- - (BOOL) sockaddr :(void *) addr :(int) size
- Set the socket address with an external socket address
- Parameters:
- addr - the socket address
size - the size of the socket address
- Returns:
- success
generated 06-Sep-2008 by ObjcDoc 3.0.0