if (jcr->file_bsock) {
Dmsg0(200, "Close File bsock\n");
- bnet_close(jcr->file_bsock);
+ jcr->file_bsock->close();
}
if (jcr->store_bsock) {
Dmsg0(200, "Close Store bsock\n");
- bnet_close(jcr->store_bsock);
+ jcr->store_bsock->close();
}
if (jcr->RestoreBootstrap) {
free(jcr->RestoreBootstrap);
set_options(current_opts, fo->opts);
for (k=0; k<fo->regex.size(); k++) {
- // bnet_fsend(fd, "R %s\n", fo->regex.get(k));
+ // fd->fsend("R %s\n", fo->regex.get(k));
current_opts->regex.append(bstrdup((const char *)fo->regex.get(k)));
}
for (k=0; k<fo->regexdir.size(); k++) {
- // bnet_fsend(fd, "RD %s\n", fo->regexdir.get(k));
+ // fd->fsend("RD %s\n", fo->regexdir.get(k));
current_opts->regexdir.append(bstrdup((const char *)fo->regexdir.get(k)));
}
for (k=0; k<fo->regexfile.size(); k++) {
- // bnet_fsend(fd, "RF %s\n", fo->regexfile.get(k));
+ // fd->fsend("RF %s\n", fo->regexfile.get(k));
current_opts->regexfile.append(bstrdup((const char *)fo->regexfile.get(k)));
}
for (k=0; k<fo->wild.size(); k++) {
btimer_t *tid = start_bsock_timer(sd, 60 * 5);
if (!sd->fsend(SDFDhello, dirname)) {
stop_bsock_timer(tid);
- Jmsg(jcr, M_FATAL, 0, _("Error sending Hello to Storage daemon. ERR=%s\n"), bnet_strerror(sd));
+ Jmsg(jcr, M_FATAL, 0, _("Error sending Hello to Storage daemon. ERR=%s\n"), sd->bstrerror());
return 0;
}
if (!cram_md5_respond(sd, store->password, &tls_remote_need, &compatible) ||
btimer_t *tid = start_bsock_timer(fd, 60 * 5);
if (!fd->fsend(SDFDhello, dirname)) {
stop_bsock_timer(tid);
- Jmsg(jcr, M_FATAL, 0, _("Error sending Hello to File daemon. ERR=%s\n"), bnet_strerror(fd));
+ Jmsg(jcr, M_FATAL, 0, _("Error sending Hello to File daemon. ERR=%s\n"), fd->bstrerror());
return 0;
}
if (!cram_md5_respond(fd, client->password, &tls_remote_need, &compatible) ||
break;
}
//writecmd(&items[i], "quit");
- bnet_sig(items[i].D_sock, BNET_TERMINATE); /* send EOF */
- bnet_close(items[i].D_sock);
+ items[i].D_sock->signal(BNET_TERMINATE); /* send EOF */
+ items[i].D_sock->close();
}
}
writecmd(item, command);
while(1) {
- if ((stat = bnet_recv(item->D_sock)) >= 0) {
+ if ((stat = item->D_sock->recv()) >= 0) {
*list = g_slist_append(*list, g_string_new(item->D_sock->msg));
}
else if (stat == BNET_SIGNAL) {
return 0;
}
else if (item->D_sock->msglen == BNET_HEARTBEAT) {
- bnet_sig(item->D_sock, BNET_HB_RESPONSE);
+ item->D_sock->signal(BNET_HB_RESPONSE);
*list = g_slist_append(*list, g_string_new(_("<< Heartbeat signal received, answered. >>\n")));
}
else {
return 0;
}
- if (is_bnet_stop(item->D_sock)) {
+ if (item->D_sock->is_stop()) {
g_string_append_printf(str, _("<STOP>\n"));
item->D_sock = NULL;
item->state = error;
if (item->D_sock) {
item->D_sock->msglen = strlen(command);
pm_strcpy(&item->D_sock->msg, command);
- bnet_send(item->D_sock);
+ item->D_sock->send();
}
}
// class destructor
console_thread::~console_thread() {
if (UA_sock) {
- bnet_sig(UA_sock, BNET_TERMINATE); /* send EOF */
- bnet_close(UA_sock);
+ UA_sock->signal(BNET_TERMINATE); /* send EOF */
+ UA_sock->close();
UA_sock = NULL;
}
}
/* main loop */
while(!TestDestroy()) { /* Tests if thread has been ended */
- stat = bnet_wait_data(UA_sock, 10);
+ stat = UA_sock->wait_data(10);
if (stat == 0) {
if (last_is_eod) {
Write(".messages\n");
}
last_is_eod = 0;
- if ((stat = bnet_recv(UA_sock)) >= 0) {
+ if ((stat = UA_sock->recv()) >= 0) {
if (do_not_forward_eod) { /* .messages got data: remove the prompt */
csprint(NULL, CS_REMOVEPROMPT);
}
if (!do_not_forward_eod)
csprint(NULL, CS_END);
} else if (UA_sock->msglen == BNET_HEARTBEAT) {
- bnet_sig(UA_sock, BNET_HB_RESPONSE);
+ UA_sock->signal(BNET_HB_RESPONSE);
csprint(_("<< Heartbeat signal received, answered. >>\n"), CS_DEBUG);
} else if (UA_sock->msglen == BNET_START_SELECT ||
UA_sock->msglen == BNET_END_SELECT) {
break;
}
- if (is_bnet_stop(UA_sock)) {
+ if (UA_sock->is_stop()) {
csprint(NULL, CS_END);
break; /* error or term */
}
if (UA_sock) {
UA_sock->msglen = (int32_t)strlen(str);
pm_strcpy(&UA_sock->msg, str);
- bnet_send(UA_sock);
+ UA_sock->_send();
} else if (choosingdirector) {
// wxString number = str;
// number.RemoveLast(); /* Removes \n */
void console_thread::Delete() {
Write("quit\n");
if (UA_sock) {
- bnet_sig(UA_sock, BNET_TERMINATE); /* send EOF */
- bnet_close(UA_sock);
+ UA_sock->signal(BNET_TERMINATE); /* send EOF */
+ UA_sock->close();
UA_sock = NULL;
/*csprint(NULL, CS_END);
csprint(NULL, CS_DISCONNECTED);