summaryrefslogtreecommitdiff
path: root/libvxi11client/libvxi11client.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvxi11client/libvxi11client.c')
-rw-r--r--libvxi11client/libvxi11client.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libvxi11client/libvxi11client.c b/libvxi11client/libvxi11client.c
index e814fdf..f19f81c 100644
--- a/libvxi11client/libvxi11client.c
+++ b/libvxi11client/libvxi11client.c
@@ -59,18 +59,17 @@ int vxi11_open(char* address, char* device) {
link = linkresp->lid;
#ifdef DEBUG
- printf("Link created, abort channel port %d\n", linkresp->abortPort);
+ printf("Link created, abort channel port %d\n", ntohs(linkresp->abortPort));
#endif
struct sockaddr_in serveraddr;
if (clnt_control(clnt, CLGET_SERVER_ADDR, (char*) &serveraddr)) {
-
#ifdef DEBUG
char addressstring[INET_ADDRSTRLEN];
*inet_ntop(AF_INET, &serveraddr.sin_addr, addressstring, sizeof(addressstring));
printf("Remote is %s\n", addressstring);
#endif
-
+ serveraddr.sin_port = linkresp->abortPort;
int sock = RPC_ANYSOCK;
abortclnt = clnttcp_create(&serveraddr, DEVICE_ASYNC, DEVICE_ASYNC_VERSION, &sock, 0, 0);
if (abortclnt == NULL)
@@ -323,7 +322,7 @@ int vxi11_destroy_intr_chan() {
int vxi11_abort() {
if (abortclnt == NULL)
return 0;
- Device_Error* error = device_abort_1(&link, clnt);
+ Device_Error* error = device_abort_1(&link, abortclnt);
if (error != NULL && error->error == 0)
return 1;
else if (error == NULL)
@@ -343,6 +342,8 @@ int vxi11_close() {
Device_Error* error = destroy_link_1(&link, clnt);
clnt_destroy(clnt);
clnt = NULL;
+ clnt_destroy(abortclnt);
+ abortclnt = NULL;
if (error != NULL && error->error == 0)
return 1;