2 * Copyright (c) 1998-1999, Index Data.
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
6 * $Log: yaz-ir-assoc.h,v $
7 * Revision 1.4 1999-03-23 14:17:57 adam
8 * More work on timeout handling. Work on yaz-client.
10 * Revision 1.3 1999/02/02 14:01:12 adam
11 * First WIN32 port of YAZ++.
13 * Revision 1.2 1999/01/28 13:08:39 adam
14 * Yaz_PDU_Assoc better encapsulated. Memory leak fix in
15 * yaz-socket-manager.cc.
17 * Revision 1.1.1.1 1999/01/28 09:41:07 adam
18 * First implementation of YAZ++.
25 #include <yaz-pdu-observer.h>
27 /** Information Retrieval Assocation.
28 This object implements the client - and server role of a generic
31 class YAZ_EXPORT Yaz_IR_Assoc : public IYaz_PDU_Observer {
33 /// Create object using the PDU Observer specified
34 Yaz_IR_Assoc(IYaz_PDU_Observable *the_PDU_Observable);
35 /// Destroy assocation and close PDU Observer
36 virtual ~Yaz_IR_Assoc();
38 void recv_PDU(const char *buf, int len);
39 /// Connect notification
41 /// Failure notification
43 /// Timeout notification
45 /// Begin Z39.50 client role
46 void client(const char *addr);
47 /// Begin Z39.50 server role
48 void server(const char *addr);
49 /// Decode Z39.50 PDU.
50 Z_APDU *decode_Z_PDU(const char *buf, int len);
51 /// Encode Z39.50 PDU.
52 int encode_Z_PDU(Z_APDU *apdu, char **buf, int *len);
54 int send_Z_PDU(Z_APDU *apdu);
55 /// Receive Z39.50 PDU
56 virtual void recv_Z_PDU(Z_APDU *apdu) = 0;
57 /// Create Z39.50 PDU with reasonable defaults
58 Z_APDU *create_Z_PDU(int type);
62 static int yaz_init_flag;
63 static int yaz_init_func();
64 IYaz_PDU_Observable *m_PDU_Observable;