Re: Getting errors on GUACD : Static Virtual Channels

2018-02-16 Thread Mike Jumper
On Fri, Feb 16, 2018 at 9:43 PM, Amarjeet Singh 
wrote:

> Thanks Mike.
>
> var output_stream = client.createPipeStream(mimetype, name);
>>
>
> As I understood the above *output_sream*  need not to be created every
> time data received instead creating it once ( defining globally ) and
> reusing it will work fine.
>
>
Just as you wouldn't repeatedly open the same file (without closing it)
every time you need to write to it, yes.

If you open a new resource, such as a Guacamole stream of any kind, you
need to keep in mind that you are consuming a finite resource. If you
continually open new resources without ever freeing them, you will
eventually run out.

https://en.wikipedia.org/wiki/Resource_leak

- Mike


Re: Getting errors on GUACD : Static Virtual Channels

2018-02-16 Thread Mike Jumper
On Fri, Feb 16, 2018 at 6:18 AM, Amarjeet Singh 
wrote:

> Hi MIke,
>
> As suggested by you, I have implemented *SIMPLE PROOF-OF-CONCEPT  
> *applications
> which  stream over separate and differently-named static channels within
> the RDP session.
>
> *STATIC VIRTUAL CHANNEL NAME* : vEcho
>
> *PURPOSE *: Continuously sending data [ Hello ]   from Remote to Local
> Browser [ Guacamole Client ]  and receiving same  data [ Hello ] from Local
> Browser  [ Guacamole Client ]  to Remote.
>
> RESULT : *It stops sending data after few seconds* whereas It is working
> fine in *mstsc and *other HTML5 solutions.
>
>
> *Guacamole Client Implementation :*
>
> client.onpipe = function(input_stream, mimetype, name) {
>>
>> if (name == "*vEcho*"  ){
>>
>> var reader = new Guacamole.ArrayBufferReader(input_stream);
>> reader.ondata = function(buffer) {
>> var rdpdata = new Uint8Array(buffer);
>> var b64encoded = btoa(String.fromCharCode.apply(null, rdpdata));
>> console.log("Receiving Data :: Name of the Channel is : - ",name);
>> console.log("Data is : - ",b64encoded);
>> var output_stream = client.createPipeStream(mimetype, name);
>> var writer = new Guacamole.ArrayBufferWriter(output_stream);
>> console.log("Sending Data :: Name of the Channel is : - ",name);
>> console.log("Data is : - ",rdpdata.buffer);
>> *writer.sendData*(rdpdata.buffer);
>> };
>>
>> }
>>
>>
>> };
>
>
>
The code you have here will exhaust the number of available streams by
repeatedly creating new pipe streams which are never closed, one for each
blob of data received. You need to invoke writer.sendEnd() to release the
underlying stream when it will no longer be used. There is likely also no
need to create an entirely new stream each time data is received; it would
be more efficient to create the secondary pipe stream only once within
onpipe, reusing that stream while the original stream remains open.

- Mike


Re: Getting errors on GUACD : Static Virtual Channels

2018-02-06 Thread Amarjeet Singh
@Mike :-

*I checked and came to know that the above error is in if else condition
which will always come for every static virtual channel.   [ Thanks Mike
] *

Point 1 : -

  Eltima is sending and receiving data continuously ( within a second there
are two to three calls ) which I can see on the console.log which means
guacamole is sending and receiving data continuously.

Point 2 :-
  Other static channels ( hyprint ) are not working when I include Eltima
static virtual channel but if I exclude Eltima other static channel works
in Guacamole.

Point 3:-
 In other RDP client all the static virtual channel  ( Eltima and Hyprint )
working fine.

Is Eltima blocking other Static Virtual channels because of sending and
receiving data continuously ( two to three calls in a seconds ) ?

There are no errors in the GUACD ?

Thanks and Regrads,
Amarjeet Singh






On Wed, Feb 7, 2018 at 6:15 AM, Mike Jumper 
wrote:

> On Tue, Feb 6, 2018 at 4:48 AM, Amarjeet Singh 
> wrote:
>
>> ...
>>
>> Feb  6 18:02:09  Guacamole-9098 guacd[16663]: Inbound half of channel
>> "usb4rdp" connected.
>> Feb  6 18:02:09  Guacamole-rms-9098 guacd: guacd[16663]: ERROR: Inbound
>> half of channel "usb4rdp" connected.
>>
>> Why I am getting this particular error in GUACD ?
>>
>>
> From an earlier thread [1]:
>
> >
> > This is not an error, but an informative message that the inbound pipe
> > stream (the pipe from the browser to the server) for your channel has
> been
> > connected. It is being logged at the wrong log level, but is not an
> error.
> >
>
> - Mike
>
> [1] https://lists.apache.org/thread.html/09cd97bd61500d1aeccb4a80264bdd
> e24c62c143c0b9efe625cc1467@%3Cuser.guacamole.apache.org%3E
>
>


Re: Getting errors on GUACD : Static Virtual Channels

2018-02-06 Thread Mike Jumper
On Tue, Feb 6, 2018 at 4:48 AM, Amarjeet Singh  wrote:

> ...
>
> Feb  6 18:02:09  Guacamole-9098 guacd[16663]: Inbound half of channel
> "usb4rdp" connected.
> Feb  6 18:02:09  Guacamole-rms-9098 guacd: guacd[16663]: ERROR: Inbound
> half of channel "usb4rdp" connected.
>
> Why I am getting this particular error in GUACD ?
>
>
>From an earlier thread [1]:

>
> This is not an error, but an informative message that the inbound pipe
> stream (the pipe from the browser to the server) for your channel has been
> connected. It is being logged at the wrong log level, but is not an error.
>

- Mike

[1]
https://lists.apache.org/thread.html/09cd97bd61500d1aeccb4a80264bdde24c62c143c0b9efe625cc1467@%3Cuser.guacamole.apache.org%3E