projects
/
yazpp-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added object Yaz_Z_Assoc. Much more functional client.
[yazpp-moved-to-github.git]
/
src
/
yaz-server.cpp
diff --git
a/src/yaz-server.cpp
b/src/yaz-server.cpp
index
c0dd47a
..
2d2c244
100644
(file)
--- a/
src/yaz-server.cpp
+++ b/
src/yaz-server.cpp
@@
-4,7
+4,13
@@
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: yaz-server.cpp,v $
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: yaz-server.cpp,v $
- * Revision 1.3 1999-02-02 14:01:22 adam
+ * Revision 1.5 1999-04-09 11:46:57 adam
+ * Added object Yaz_Z_Assoc. Much more functional client.
+ *
+ * Revision 1.4 1999/03/23 14:17:57 adam
+ * More work on timeout handling. Work on yaz-client.
+ *
+ * Revision 1.3 1999/02/02 14:01:22 adam
* First WIN32 port of YAZ++.
*
* Revision 1.2 1999/01/28 13:08:47 adam
* First WIN32 port of YAZ++.
*
* Revision 1.2 1999/01/28 13:08:47 adam
@@
-17,16
+23,17
@@
*/
#include <log.h>
*/
#include <log.h>
-#include <yaz-ir-assoc.h>
+#include <yaz-z-assoc.h>
#include <yaz-pdu-assoc.h>
#include <yaz-socket-manager.h>
#include <yaz-pdu-assoc.h>
#include <yaz-socket-manager.h>
-class MyServer : public Yaz_IR_Assoc {
+class MyServer : public Yaz_Z_Assoc {
public:
MyServer(IYaz_PDU_Observable *the_PDU_Observable);
void recv_Z_PDU(Z_APDU *apdu);
IYaz_PDU_Observer* clone(IYaz_PDU_Observable *the_PDU_Observable);
void failNotify();
public:
MyServer(IYaz_PDU_Observable *the_PDU_Observable);
void recv_Z_PDU(Z_APDU *apdu);
IYaz_PDU_Observer* clone(IYaz_PDU_Observable *the_PDU_Observable);
void failNotify();
+ void timeoutNotify();
private:
int m_no;
};
private:
int m_no;
};
@@
-59,27
+66,36
@@
void MyServer::recv_Z_PDU(Z_APDU *apdu)
IYaz_PDU_Observer *MyServer::clone(IYaz_PDU_Observable *the_PDU_Observable)
{
IYaz_PDU_Observer *MyServer::clone(IYaz_PDU_Observable *the_PDU_Observable)
{
- logf (LOG_LOG, "clone %d", m_no);
+ logf (LOG_LOG, "child no %d", m_no);
m_no++;
return new MyServer(the_PDU_Observable);
}
MyServer::MyServer(IYaz_PDU_Observable *the_PDU_Observable) :
m_no++;
return new MyServer(the_PDU_Observable);
}
MyServer::MyServer(IYaz_PDU_Observable *the_PDU_Observable) :
- Yaz_IR_Assoc (the_PDU_Observable)
+ Yaz_Z_Assoc (the_PDU_Observable)
{
m_no = 0;
}
{
m_no = 0;
}
+void MyServer::timeoutNotify()
+{
+ logf (LOG_LOG, "connection timed out");
+ delete this;
+}
+
void MyServer::failNotify()
{
void MyServer::failNotify()
{
+ logf (LOG_LOG, "connection closed by client");
delete this;
}
int main(int argc, char **argv)
{
Yaz_SocketManager mySocketManager;
delete this;
}
int main(int argc, char **argv)
{
Yaz_SocketManager mySocketManager;
+ Yaz_PDU_Assoc *my_PDU_Assoc = new Yaz_PDU_Assoc(&mySocketManager, 0);
- MyServer z(new Yaz_PDU_Assoc(&mySocketManager, 0));
+ my_PDU_Assoc->idleTime(20);
+ MyServer z(my_PDU_Assoc);
if (argc <= 1)
z.server("@:9999");
if (argc <= 1)
z.server("@:9999");