1 // $Header: /home/cvsroot/yaz++/zoom/zconn.cpp,v 1.2 2002-08-08 16:06:08 mike Exp $
3 // Z39.50 Connection class
9 connection::connection(const char *hostname, int portnum) {
10 c = ZOOM_connection_new(hostname, portnum);
13 const char *errmsg; // unused: carries same info as `errcode'
15 if ((errcode = ZOOM_connection_error(c, &errmsg, &addinfo)) != 0) {
16 throw bib1Exception(errcode, addinfo);
20 const char *connection::option(const char *key) const {
21 return ZOOM_connection_option_get(c, key);
24 const char *connection::option(const char *key, const char *val) {
25 // ### There may be memory-management issues here.
26 const char *old = ZOOM_connection_option_get(c, key);
27 ZOOM_connection_option_set(c, key, val);
31 connection::~connection() {
32 ZOOM_connection_destroy(c);