nanogui: LoadImageFriomFile function


Previous by date: 19 Dec 2004 01:32:29 +0000 Re: Linking nano-X into my application?, Steven Scholz
Next by date: 19 Dec 2004 01:32:29 +0000 Re: Linking nano-X into my application?, Greg Haerr
Previous in thread:
Next in thread:

Subject: LoadImageFriomFile function
From: "Finn S. Nielsen" ####@####.####
Date: 19 Dec 2004 01:32:29 +0000
Message-Id: <008701c4e56a$990a9c40$0a2ca8c0@FNDELL>

Earlier this month I was having troubles getting the nanox / nxview
application demo to work.

I proceeded by putting in printf's around strategic places in the code.
Then suddenly it started to work...
Removing some of the printfs again, made to stop working again.
Not sure what's going on, but on the client side it fails reading from the
socket connection.
Actually I can't see where or how are requests sent to the server - like in:
---------
GR_IMAGE_ID
GrLoadImageFromFile(char *path, int flags)
{
 nxLoadImageFromFileReq *req;
 GR_IMAGE_ID  imageid;

fprintf(stderr, "Calling AllocReqExtra\n");
 req = AllocReqExtra(LoadImageFromFile, strlen(path)+1);
 req->flags = flags;
fprintf(stderr, "going to memcpy\n");
 memcpy(GetReqData(req), path, strlen(path)+1);
fprintf(stderr, "calling GrTypedReadBlock\n");
 if(GrTypedReadBlock(&imageid, sizeof(imageid),
  GrNumLoadImageFromFile) == -1)
   return 0;
 return imageid;
}
-----
I see the wait for a response... but where/how is the request dispatched ?

Below is the output when trying to display a GIF picture using nxview.
---------
nxview /var/fractal2.gif
HandleClient GrOpen
Calling AllocReqExtra
going to memcpy
calling GrTypedReadBlock
entering GrReadBlock
HandleClient GrLoadImageFromFile
GdLoadImageFromFile: opened file /var/fractal2.gif OK
malloced OK
LoadGif - 1
LoadGif - 2
LoadGif - 3
LoadGif - 4, result=1
Closing file
Allocate id
GdListAdd
Returning 1
GdLoadImageFromFile returned 1
malloc success
calling GsWriteType, current_fd=5
Read from socket 3, result=2
entering GrReadBlock
calling GsWrite
Read from socket 3, result=4
GrLoadImageFromFile done
entering GrReadBlock
GrLoadImageFromFileWrapper exit
Read from socket 3, result=-1
nxclient: bad readblock -1
nxclient 30: Corrupted packet
entering GrReadBlock
pid 30: failed 13
-----------
What's could be going on here ?

regards,

Finn S. Nielsen
Denmark


Previous by date: 19 Dec 2004 01:32:29 +0000 Re: Linking nano-X into my application?, Steven Scholz
Next by date: 19 Dec 2004 01:32:29 +0000 Re: Linking nano-X into my application?, Greg Haerr
Previous in thread:
Next in thread:


Powered by ezmlm-browse 0.20.