/*
- * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc. All Rights Reserved.
+ * Copyright (c) 2007-2012 Zmanda, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
return device_finish(self);
}
+ guint64
+ get_bytes_read() {
+ return device_get_bytes_read(self);
+ }
+
+ guint64
+ get_bytes_written() {
+ return device_get_bytes_written(self);
+ }
+
gboolean
start_file(dumpfile_t *jobInfo) {
return device_start_file(self, jobInfo);
return conn;
}
+ %newobject accept_with_cond; /* connection is already ref'd, so we own it */
+ DirectTCPConnection *
+ accept_with_cond(GMutex *abort_mutex, GCond *abort_cond) {
+ DirectTCPConnection *conn = NULL;
+ gboolean rv;
+
+ rv = device_accept_with_cond(self, &conn, abort_mutex, abort_cond);
+ if (!rv && conn) {
+ /* conn is ref'd for our convenience, but we don't want it */
+ g_object_unref(conn);
+ conn = NULL;
+ }
+ return conn;
+ }
+
%newobject connect; /* connection is already ref'd, so we own it */
DirectTCPConnection *
connect(gboolean for_writing, DirectTCPAddr *addrs) {
return conn;
}
+ %newobject connect_with_cond; /* connection is already ref'd, so we own it */
+ DirectTCPConnection *
+ connect_with_cond(gboolean for_writing, DirectTCPAddr *addrs,
+ GMutex *abort_mutex, GCond *abort_cond) {
+ DirectTCPConnection *conn = NULL;
+ gboolean rv;
+
+ rv = device_connect_with_cond(self, for_writing, addrs, &conn,
+ abort_mutex, abort_cond);
+ if (!rv && conn) {
+ /* conn is ref'd for our convenience, but we don't want it */
+ g_object_unref(conn);
+ conn = NULL;
+ }
+ return conn;
+ }
+
gboolean
use_connection(DirectTCPConnection *conn) {
return device_use_connection(self, conn);