In fact the lab Client/Server (Simple Socket)
is just about that: how to call a server remotely,
but also how to probe vitality of a standalone server
from an interactive J client.
This can be useful, for example, to debug live
sessions of JHP. To interactively explore parameters, etc.
As an alternative to trace statements in code.
Before you try, make yourself familiar with the lab
and run a few sessions in jconsole as server to
test it out.
You may want to increase CGI timeout. In IIS GUI:
Web Sites/Home Dir/Config/Process Opts/CGI timeout
To try it in JHP, insert in web/jhp/run.ijs before
the first "try.":
load '~system/classes/cs/jsss_demo.ijs'
if. -.'viewsrc.jhp'-:_11{.CGIPATH_j_ do.init__ 1200 end.
Before you navigate to any JHP page, have a J
client running, and enter:
load '~system/classes/cs/jssc.ijs'
c=: 1200 conew 'jssc' NB. create client
It will suspend. Now when you navigate, enter:
su__c 'fubar' NB. allow execute
su_execute__c 'names'''''
COCREATOR DESTROY data docmd lasterror senddata sk
su writeready
su_execute__c 'i.4'
0 1 2 3
su_execute__c '2!:5''path_translated'''
...\j601\addons\web\jhp\examples\ht1.jhp
su_interrupt__c''
The CGI will resume execution and return to response.
To kill CGI without response issue,
su_shutdown__c''
The web browser will report CGI error: it's OK.
When you are done, check process list and kill off
any jconsole left running in CGI.
However, there are some problems with the
socket server is implemented.
1. Error processing does not work correcly. It should
pass error info to the client and the client needs
to either just report it or throw its own signal (maybe better).
su_execute__c '12qq'
|index error: call
| (>1 {d)13!:8[3
2. There is no method to fully "uninit" the server,
only "interrupt/run" (which does not unbind the sockets)
and "shutdown" (which kills the process). So there
is no way to resume clean normal operation.
3. The locale treatment is intrusive: the commands are
- current locale is of the server; should be base,
I believe this is possible if the run loop is excuted
as run_jsss_.
su_execute__c 'names'''''
COCREATOR DESTROY data docmd lasterror senddata sk
su writeready
- base locale is treated for working state of the server;
it should use its own locale for any of it names, and keep base clean.
su_execute__c 'names__ 0' NB. nouns in server base locale
WAITS d data hostaddress logfile loop
port r servers shutdownflag sk skclient
sockets timeout
There are also some limitations due to the environment:
- Some functionality does not work, whereas it works
in jconsole client, e.g. executing tasks in Windows
su_execute__c 'load''task'''
su_execute__c 'shell''set'''
... nothing happens
--- Alex Rufon <[EMAIL PROTECTED]> wrote:
> Is this possible? I really hope it is.
>
> You see, some of my design decisions is based on the procedure where I
> need the actual J Window showing so I can step through the code line by
> line. Query the current values and understanding what the problem is
> with the data.
>
> Around 98% of problems that I encounter in production systems are bad
> data. There are even cases that users are even able to enter data that
> they should not be able to enter. Unfortunately, without J Window in
> your control ... it's next to impossible to do so.
>
> Being able to debug remotely without stopping the server and being able
> to pick which instance to debug is something that would be very-very
> helpful.
>
> :)
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Oleg Kobchenko
> Sent: Friday, February 16, 2007 2:32 PM
> To: General forum
> Subject: [Jgeneral] Remote J Debugging
>
> That brings about an interesting idea:
> Remote J Debugging. Useful for command-line
> and headless jconsole processes like CGI.
>
> GUI Debugger is implemented in J. There is also
> J remoting interface via sockets. So it would be
> possible to debug a headless instance of J with
> a GUI instance of J communicating with this remoting.
>
> Would be also a good "real-world" example of remoting
> J programming.
>
> Implementation note: existing debugger is split into
> two parts: client and server. Client sets
> debugging mode and when debug condition occurs,
> attaches (starts or resumes) to the server, the
> server showing the GUI. They communicate with a
> protocol to update GUI and pass GUI events that control
> debugging settings and commands like "step" to
> the client.
>
>
> --- Alex Rufon <[EMAIL PROTECTED]> wrote:
>
> > Arrrgggghhh! Old habits really die hard. My J601 workspace has the
> > allowed x. and y. enabled. You see, I still have running installation
> of
> > J504 in Vietnam, Saipan, Taiwan, Dongguan and the Philippines that I
> am
> > supporting. I really want to upgrade them but the Powers That Be is
> > playing the Don't Fix the Not Broken card. :)
> >
> > Sorry about the RAR thingy. I was having trouble uploading and I don't
> > want to clog Chris email that I double compressed it.
> >
> > About the Session Window, this is something that I picked up from
> Chris
> > Burke. I believe that this is how they envisioned J will be used
> during
> > testing/development cycle. I actually find this handy. You see, I have
> > implementation of J running the Web, App, database servers (3-Tier
> > Systems) and on the Client. I designed my J .NET wrapper for servers
> in
> > such a way that when I need to debug a code in production, I can
> easily
> > switch the whole server side system to run on a single instance of J
> ...
> > instead of the normal multiple instances. This way, I can actually
> catch
> > all calls and execution on one Session Window.
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of David Mitchell
> > Sent: Thursday, February 15, 2007 10:38 PM
> > To: General forum
> > Subject: Re: [Jgeneral] J.NET Guide
> >
> > Alex Rufon wrote:
> > > The file download for the "Real World Example" is now working. :)
> > >
> >
> > I downloaded the zip and (after a brief tussle with unrar) installed
> it.
> > I
> > tried running the program
> > D:\Projects\J.NET\timedeviceviewer\bin\Debug\timedeviceviewer.exe and
> > got:
> >
> > |spelling error
> > | 10000 100 100 base y.
> > | ^
> > | dateencode=: 3 :0
> > |[-343] D:\Projects\J.NET\timedeviceviewer.ijs
____________________________________________________________________________________
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm