2 * Copyright (c) 1998-1999, Index Data.
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
6 * $Log: yaz-z-assoc.h,v $
7 * Revision 1.1 1999-04-09 11:47:23 adam
8 * Added object Yaz_Z_Assoc. Much more functional client.
14 #include <yaz-pdu-observer.h>
16 /** Z39.50 Assocation.
17 This object implements the client - and server role of a generic
20 class YAZ_EXPORT Yaz_Z_Assoc : public IYaz_PDU_Observer {
22 /// Create object using the PDU Observer specified
23 Yaz_Z_Assoc(IYaz_PDU_Observable *the_PDU_Observable);
24 /// Destroy assocation and close PDU Observer
25 virtual ~Yaz_Z_Assoc();
27 void recv_PDU(const char *buf, int len);
28 /// Connect notification
30 /// Failure notification
32 /// Timeout notification
34 /// Begin Z39.50 client role
35 void client(const char *addr);
36 /// Begin Z39.50 server role
37 void server(const char *addr);
40 /// Decode Z39.50 PDU.
41 Z_APDU *decode_Z_PDU(const char *buf, int len);
42 /// Encode Z39.50 PDU.
43 int encode_Z_PDU(Z_APDU *apdu, char **buf, int *len);
45 int send_Z_PDU(Z_APDU *apdu);
46 /// Receive Z39.50 PDU
47 virtual void recv_Z_PDU(Z_APDU *apdu) = 0;
48 /// Create Z39.50 PDU with reasonable defaults
49 Z_APDU *create_Z_PDU(int type);
53 static int yaz_init_flag;
54 static int yaz_init_func();
55 IYaz_PDU_Observable *m_PDU_Observable;