summaryrefslogtreecommitdiff
path: root/libvxi11client
diff options
context:
space:
mode:
authordaniel <danieruru@gmail.com>2013-01-10 21:47:42 +0900
committerdaniel <danieruru@gmail.com>2013-01-10 21:47:42 +0900
commit48577c89c567a0d9f6efc88dc03fb94258b17fd5 (patch)
tree5c2cb34e07cfc8621910d464438945851fc393f0 /libvxi11client
parent0e75195fd93cb3e4eb0c1e29eca11894edf5c076 (diff)
more filling out on the server side
Diffstat (limited to 'libvxi11client')
-rw-r--r--libvxi11client/client.c4
-rw-r--r--libvxi11client/libvxi11client.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/libvxi11client/client.c b/libvxi11client/client.c
index 816d2f3..04753a8 100644
--- a/libvxi11client/client.c
+++ b/libvxi11client/client.c
@@ -128,10 +128,12 @@ int main(int argc, char *argv[]) {
printf("error unlocking; %s\n", geterrorstring(err));
printf("\n");
- // create interrupt channel
+ // Interrupt channel tests
printf("-- Testing interrupt channel --\n");
+ // create interrupt channel
if ((err = vxi11_create_intr_chan()) > 0) {
printf("Created interrupt channel\n");
+ sleep(10);
// destroy interrupt channel
if ((err = vxi11_destroy_intr_chan()) > 0)
printf("Destroyed interrupt channel\n");
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);