* Copyright (c) 1998-2001, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-z-assoc.cpp,v 1.25 2002-10-09 12:50:26 adam Exp $
+ * $Id: yaz-z-assoc.cpp,v 1.27 2003-10-10 12:37:26 adam Exp $
*/
#include <assert.h>
Z_APDU *apdu = decode_Z_PDU (buf, len);
if (apdu)
{
- recv_Z_PDU (apdu);
+ recv_Z_PDU (apdu, len);
}
else
{
*id_to = 0;
}
-int Yaz_Z_Assoc::send_Z_PDU(Z_APDU *apdu)
+int Yaz_Z_Assoc::send_Z_PDU(Z_APDU *apdu, int *plen)
{
char *buf;
int len;
if (encode_Z_PDU(apdu, &buf, &len) > 0)
+ {
+ if (plen)
+ *plen = len;
return m_PDU_Observable->send_PDU(buf, len);
+ }
return -1;
}
return m_hostname;
}
-void Yaz_Z_Assoc::client(const char *addr)
+int Yaz_Z_Assoc::client(const char *addr)
{
delete [] m_hostname;
m_hostname = new char[strlen(addr)+1];
strcpy (m_hostname, addr);
- m_PDU_Observable->connect (this, addr);
+ return m_PDU_Observable->connect (this, addr);
}
void Yaz_Z_Assoc::close()