X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fyaz%2B%2B%2Fpdu-assoc.h;fp=include%2Fyaz%2B%2B%2Fpdu-assoc.h;h=0000000000000000000000000000000000000000;hb=0cc824e02bc2c69986bec8c9dd9ff53f07a0cd3d;hp=b981174f1511a2c098e8b1f921c37a205acb87b6;hpb=76d66b222afff97cf367a3e7b8bfe045a62d0d57;p=yazpp-moved-to-github.git diff --git a/include/yaz++/pdu-assoc.h b/include/yaz++/pdu-assoc.h deleted file mode 100644 index b981174..0000000 --- a/include/yaz++/pdu-assoc.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 1998-2005, Index Data. - * See the file LICENSE for details. - * - * $Id: pdu-assoc.h,v 1.9 2006-03-28 19:51:38 adam Exp $ - */ - -#ifndef YAZ_PDU_ASSOC_INCLUDED -#define YAZ_PDU_ASSOC_INCLUDED - -#include -#include -#include - -namespace yazpp_1 { -/** Simple Protocol Data Unit Assocation. - This object sends - and receives PDU's using the COMSTACK - network utility. To use the association in client role, use - the method connect. The server role is initiated by using the - listen method. - */ -class YAZ_EXPORT PDU_Assoc : public IPDU_Observable, yazpp_1::ISocketObserver { - friend class PDU_AssocThread; - private: - enum { - Connecting, - Listen, - Ready, - Closed, - Writing, - Accepting - } m_state; - class PDU_Queue { - public: - PDU_Queue(const char *buf, int len); - ~PDU_Queue(); - char *m_buf; - int m_len; - PDU_Queue *m_next; - }; - PDU_Assoc *m_parent; - PDU_Assoc *m_children; - PDU_Assoc *m_next; - COMSTACK m_cs; - yazpp_1::ISocketObservable *m_socketObservable; - IPDU_Observer *m_PDU_Observer; - char *m_input_buf; - int m_input_len; - PDU_Queue *m_queue_out; - PDU_Queue *m_queue_in; - int flush_PDU(); - int *m_destroyed; - int m_idleTime; - int m_log; - void init(yazpp_1::ISocketObservable *socketObservable); - public: - COMSTACK comstack(const char *type_and_host, void **vp); - /// Create object using specified socketObservable - PDU_Assoc(yazpp_1::ISocketObservable *socketObservable); - /// Create Object using existing comstack - PDU_Assoc(yazpp_1::ISocketObservable *socketObservable, - COMSTACK cs); - /// Close socket and destroy object. - /// virtual ~PDU_Assoc(); - /// Clone the object - IPDU_Observable *clone(); - /// Send PDU - int send_PDU(const char *buf, int len); - /// connect to server (client role) - int connect(IPDU_Observer *observer, const char *addr); - /// listen for clients (server role) - int listen(IPDU_Observer *observer, const char *addr); - /// Socket notification - void socketNotify(int event); - /// Close socket - void close(); - /// Close and destroy - void destroy(); - /// Set Idle Time - void idleTime (int timeout); - /// Child start... - virtual void childNotify(COMSTACK cs); - const char *getpeername(); -}; - -class YAZ_EXPORT PDU_AssocThread : public PDU_Assoc { - public: - PDU_AssocThread(yazpp_1::ISocketObservable *socketObservable); - private: - void childNotify(COMSTACK cs); - -}; -}; - -#endif - -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ -