the_Foundation 1.0
Loading...
Searching...
No Matches
Data Structures | Typedefs | Enumerations | Functions | Variables
address.h File Reference
#include "object.h"
#include "audience.h"
#include "string.h"

Data Structures

struct  iAddressClass
 
struct  iSocketParameters
 

Typedefs

typedef struct Impl_Address iAddress
 
typedef void(* iNotifyAddressLookupFinished) (iAny *, const iAddress *)
 

Enumerations

enum  iSocketType { tcp_SocketType , udp_SocketType }
 
enum  iSocketStringFlags { noPort_SocketStringFlag = 0x1 }
 

Functions

iAddress * new_Address (void)
 
void init_Address (iAddress *d)
 
void deinit_Address (iAddress *d)
 
iAddress * newBroadcast_Address (uint16_t port)
 
iAddress * newSockAddr_Address (const void *sockAddr, size_t sockAddrSize, enum iSocketType socketType)
 
iBool equal_Address (const iAddress *, const iAddress *other)
 
iBool isHostFound_Address (const iAddress *)
 
iBool isValid_Address (const iAddress *)
 
int count_Address (const iAddress *)
 
iSocketParameters socketParametersIndex_Address (const iAddress *d, int index)
 
iSocketParameters socketParametersFamily_Address (const iAddress *, int family)
 
iString * toString_Address (const iAddress *)
 
iString * toStringFlags_Address (const iAddress *, int flags, int family)
 
const iString * hostName_Address (const iAddress *)
 
uint16_t port_Address (const iAddress *)
 
iBool isPending_Address (const iAddress *)
 
void lookupCStr_Address (iAddress *, const char *hostName, uint16_t port, enum iSocketType socketType)
 
void waitForFinished_Address (const iAddress *)
 
iAudience * lookupFinished_Address (iAddress *d)
 
iObjectList * networkInterfaces_Address (void)
 

Variables

iAddressClass Class_Address
 

Detailed Description

Network address.

Authors
Copyright (c) 2017 Jaakko Keränen jaakk.nosp@m.o.ke.nosp@m.ranen.nosp@m.@iki.nosp@m..fi
License

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ lookupCStr_Address()

void lookupCStr_Address ( iAddress * ,
const char * hostName,
uint16_t port,
enum iSocketType socketType )

Starts an asynchronous address lookup. The lookupFinished audience will be notified when the operation is complete. Alternatively, one can use waitForFinished_Address() to block until the lookup is done.

Parameters
hostNameHostname to look up. This can be a numerical IP address or a host name that will be looked up via DNS. If the hostname is an empty string or NULL, the address will represent any available local network interface.
portTCP/UDP port number.
socketTypeType of the socket (TCP/UDP).