From 48577c89c567a0d9f6efc88dc03fb94258b17fd5 Mon Sep 17 00:00:00 2001
From: daniel <danieruru@gmail.com>
Date: Thu, 10 Jan 2013 21:47:42 +0900
Subject: more filling out on the server side

---
 libvxi11client/libvxi11client.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'libvxi11client/libvxi11client.c')

diff --git a/libvxi11client/libvxi11client.c b/libvxi11client/libvxi11client.c
index cf57f17..2f36147 100644
--- a/libvxi11client/libvxi11client.c
+++ b/libvxi11client/libvxi11client.c
@@ -117,7 +117,7 @@ int vxi11_open(char* address, char* device) {
 			link = linkresp->lid;
 
 #ifdef DEBUG
-			printf("Link created, abort channel port %d\n", ntohs(linkresp->abortPort));
+			printf("Link created, lid is %d, abort channel port %d\n", linkresp->lid, linkresp->abortPort);
 #endif
 
 			struct sockaddr_in serveraddr;
@@ -127,7 +127,7 @@ int vxi11_open(char* address, char* device) {
 				inet_ntop(AF_INET, &serveraddr.sin_addr, addressstring, sizeof(addressstring));
 				printf("Remote is %s\n", addressstring);
 #endif
-				serveraddr.sin_port = linkresp->abortPort;
+				serveraddr.sin_port = htons(linkresp->abortPort);
 				int sock = RPC_ANYSOCK;
 				abortclnt = clnttcp_create(&serveraddr, DEVICE_ASYNC, DEVICE_ASYNC_VERSION, &sock, 0, 0);
 				if (abortclnt == NULL)
@@ -359,7 +359,7 @@ static gpointer interruptthreadfunc(gpointer data) {
 		fprintf(stderr, "%s", "unable to register (DEVICE_INTR, DEVICE_INTR_VERSION, tcp).\n");
 		return 0;
 	}
-	*((u_short*) data) = transp->xp_port;
+	*((unsigned int*) data) = transp->xp_port;
 
 	int no_of_fds;
 	int i;
@@ -400,7 +400,7 @@ int vxi11_create_intr_chan() {
 		return 0;
 
 	interruptchannelopen = true;
-	u_short port = -1;
+	unsigned int port = -1;
 	g_thread_init(NULL);
 	interruptthread = g_thread_create(interruptthreadfunc, &port, true, NULL);
 
-- 
cgit