•  Back 
  •  Message-list 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help page 
  •  Show info about hypertext 
  •  View a new file 
Topic       : TOS - The Operating System
Author      : 
Version     : tos.hyp (December 19, 2008)
Subject     : Programmieren/Atari
Nodes       : 3010
Index Size  : 93790
HCP-Version : 5
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Title
@help       : 
@options    : +g -i -s +x +zz -t4
@width      : 70
View Ref-File8.7.9.3  RSDAEMON_MSG                                              TOS

The RSDAEMON is a parallel-running application which assumes the task 
of the resolver with an AES message. It's intended as a kind of non- 
blocking gethostbyname, although the RSDAEMON only returns an IP, not 
a complete hostent-struct.

The RSDAEMON is normally started and terminated automatically by 
IConnect.

Utilization:

With appl_find("RSDAEMON") the App ID is to be obtained. In case of 
error one should fall back to the blocking gethostbyname, and only if 
nothing else is possible, break off with an error-message.

Now the RSDAEMON can be sent an AES message:

#include <rsdaemon.h>

pbuf[0]=RSDAEMON_MSG
pbuf[1]=<eigene App-ID>
pbuf[2]=0
pbuf[3]=RSD_REQUEST_IP
pbuf[4]=<Own freely choosable ID, to be able to assign the reply>
pbuf[5/6]=<Pointer to the string that contains the nname of the host>
           (Pay attention to possible memory protection!)

The RSDAEMON returns a reply of the following form:

pbuf[0]=RSDAEMON_MSG
pbuf[1]=<RSDAEMON ID>
pbuf[2]=0

pbuf[3]=RSD_IP_UNKNOWN = IP could not be obtained. This may be due to
                         various causes (user has not entered a DNS,
                         the DNS does not recognize the host etc.)
pbuf[4]=<Here the ID of the request is returned>

or:

pbuf[3]=RSD_IP_FOUND
pbuf[4]=<Here the ID of the request is returned>
pbuf[5/6]=<IP of the host as ulong>

And here still the RSDAEMON.H:

#ifndef __RSDAEMON__
#define __RSDAEMON__

#define RSDAEMON_MSG    0x995

#define RSD_REQUEST_IP  1
#define RSD_IP_FOUND            2
#define RSD_IP_UNKNOWN  3

#endif