AServer programmers guide
May 1995
INMOS document number: 72-TDS-403-02
150 Pages
© SGS-Thomson 1995.
Introduction
The AServer (Asynchronous Server) system is a high performance interface system which allows multiple processes on a target device to communicate via a hardware serial link with multiple processes on some external device. The AServer software acts as a standard interface which is independent of the hardware used.
The AServer system supports the new generation of INMOS development tools such as the INQUEST interactive debugger.
The AServer is a collection of programs, interface libraries and protocols that together create a system to enable applications running on target hardware to access external services in a way that is consistent, extensible and open. The software elements provided are:
- a target gateway which runs on the target (see Chapter 3);
- an irun gateway which runs on the host (see Chapter 2);
- an iserver service which runs on the host (see Chapter 4);
- an iserver converter which runs on the target (see Chapter 4);
- a library of interface routines for use by client and service processes (see Chapter 6);
- simple example services.
Contents
1 Introduction 1.1 AServer features 1.2 Gateways 1.3 Clients and services 1.4 Protocols 1.5 Access points 1.6 Using the AServer with occam 2 irun 2.1 Running irun 2.1.1 Environment variables 2.1.2 Starting AServer applications 2.2 The AServer database 2.2.1 AServer database service resources 2.2.2 AServer database connection resources 2.3 Implementation limit 3 The target gateway 3.1 Configuration example 3.2 Mega-packets 4 iserver service 4.1 Auto-iserver mode 4.1.1 Use with the iserver converter 4.1.2 Parameters 4.2 iserver converter 4.3 Hello example 4.3.1 The Hello client 4.3.2 Configuring the Hello example 4.3.3 Building the Hello example 4.3.4 Running the Hello example 4.4 Hello2 example 4.4.1 Configuring the Hello2 example 4.4.2 Running the Hello2 example 4.5 Getkey Example 5 Clients and services 5.1 Introduction 5.2 Initializing data structures 5.3 Waiting for packets to arrive 5.3.1 AServer callback 5.4 Connecting and disconnecting 5.5 Sending and receiving 5.5.1 Packet level communications 5.6 Terminating data structures 5.7 Echo example 5.7.1 Echo client 5.7.2 Configuration of the Echo client 5.7.3 Echo service 5.8 Callback 5.8.1 Read callback 5.8.2 AServer callback 5.9 Print example 5.9.1 The Print client 5.9.2 Configuring the Print client 5.9.3 The Print service 5.9.4 The AServer database 5.10 occam clients 6 AServer library 6.1 Restrictions 6.2 Function prototype and constant files 6.3 Data types and macros 6.4 Constants and limits 6.5 Callbackfunction type definition 6.5.1 AserverProc 6.5.2 as_readpktcb 6.6 Functions 6.6.1 asc_connect 6.6.2 asc_disconnect 6.6.3 ass_acceptconnect 6.6.4 ass_processconnect 6.6.5 ass_sendabort 6.6.6 ass_set_cb 6.6.7 as_apfinish 6.6.8 as_apstart 6.6.9 as_asrc_to_str 6.6.10 as_bool_to_str 6.6.11 as_decode_conn_req 6.6.12 as_get_conn_info 6.6.13 as_give_ap_ptr 6.6.14 as_hdr_get_conn_num 6.6.15 as_hdr_get_gateway_i 6.6.16 as_hdr_get_len 6.6.17 as_hdr_get_p_byte 6.6.18 as_hdr_get_type 6.6.19 as_hdr_set_conn_num 6.6.20 as_hdr_set_gateway_i 6.6.21 as_hdr_set_len 6.6.22 as_hdr_set_p_byte 6.6.23 as_hdr_set_type 6.6.24 as_hdr_to_str 6.6.25 as_numaps 6.6.26 as_pack_hdr 6.6.27 as_pack_int32 6.6.28 as_pack_uint16 6.6.29 as_pack_uint32 6.6.30 as_ptype_to_str 6.6.31 as_read_ready 6.6.32 as_recmessage 6.6.33 as_rec_packet 6.6.34 as_sendmessage 6.6.35 as_send_packet 6.6.36 as_setconntable 6.6.37 as_set_dest 6.6.38 as_translate_pkt 6.6.39 as_unpack_hdr 6.6.40 as_unpack_int32 6.6.41 as_unpack_unit16 6.6.42 as_unpack_uint32 Appendices A AServer example code A.1 Running the examples A.1.1 AServer database A.1.2 Target processor A.1.3 Environment A.1.4 Building the examples A.2 Hello2 example A.2.1 The Hello client A.2.2 Configuring the Hello example A.2.3 Building the Hello example A.2.4 Running the Hello example A.3 Hello2 example A.3.1 Configuring the Hello2 example A.4 Getkey Example A.4.1 The main program A.4.2 Configuring the getkey example A.5 Echo example A.5.1 Echo client in ANSI C A.5.2 Echo client in occam A.5.3 Configuration of the Echo client A.5.4 Building the Echo target code A.5.5 Echo service for PC host A.5.6 Building the Echo host code A.5.7 Echo service for Sun host A.6 Print example A.6.1 The Print client A.6.2 Configuring the Print client A.6.3 Building the Print target code A.6.4 The Print service for PC hosts A.6.5 Building the Print host code A.6.6 The Print service for Sun hosts B AServer protocols B.1 Introduction B.2 Packets B.3 Messages B.3.1 Connect request messages B.3.2 Connect reply messages B.3.3 Disconnect request messages B.3.4 Disconnect reply messages B.3.5 Data messages B.3.6 Control messages B.3.7 Abort request messages B.3.8 Result codes B.4 Mega-packetprotocol C AServer result codes D Glossary Index