Hi Jack,

If you really need this, I still have a J server somewhere in my backup
disks at home. It was built using J504 with ICE (internet communication
engine) http://www.zeroc.com

I believe I can modify/upgrade it for J602 and the latest release of
ICE.

The concept is to use ICE as the middleware and J running on the server
(anywhere in the world) then you have a J client on your machine and you
can decide if you want to execute a J command on the server or on the
client. 

The concept is actually quite simple.
1. You have J both on the client and the server.
2. Setup a communication protocol (namepipes, sockets, dcom, .NET
remoting, etc)
3. Client sends a command to server as a byte array.
        NB. Convert the command string, with some text data and numeric
data into a byte array
        Servercmd=. 3!:1 'sampleserversidecommand';<'sometextdata';i.
500 5
4. Send this over the wire as a byte array, it's up to you what protocol
you want to use. You can even compress and/or encrypt the data.
5. J Server now converts data back into its original format:
        NB. Convert the data back from byte array to actual value
        temp=. 3!:2 recieveddata
6. Execute the command
        NB. Distinguish between the command and data
      'command data'=. 2 take temp
        NB. Execute the command in server side
        result=. (command)~ data
7. Now encode the data back to binary form, but I normally put the error
code as first item
        NB. Normally, errcode = 0 if there are no error
        returnvalue=. 3!:1 errcode;<result
8. Return the data to the client, again using your protocol, preferably
with encryption and compression
9. The client now decodes the data and checks if there was an error
        temp=. 3!:2 recieveddata
        'errorcode data'=. 2 take temp

NOTE: The above is just my preferred way of doing client-server thingy.
You can actually send a normal command like 
CLIENT-SIDE:
        data4server=. 3!:1 '+/i. 20 5'
      returnval=. 3!:2 serverexec data4server
SERVER-SIDE
      datafromclient=. 3!:2 recieveddata
      [forclient=. ". datafromclient
950 970 990 1010 1030
      dataforclient=. 3!:1 forclient

The ICE protocol is actually blazingly fast as compared to pure TCP
protocol. The only reason I didn't commercially use it or actually
release my code (by posting it in the J WIKI) for it is because of the
GPL license. I don't know enough legalize to release code for it. I
vaguely seem to remember that if you use a GPL library ... your project
becomes GPL too. I would gladly post the code in the J WIKI if somebody
could tell me that it is safe to do so.

r/alex

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Eric Iverson
Sent: Wednesday, February 04, 2009 3:32 AM
To: Programming forum
Subject: Re: [Jprogramming] jep

JEP (J Engine Protocol) was decommitted in J602. See the notes in
Help>Release Highlights.

On that same page you might be interested in J Front End - Example
Source
Code.

Or if you want a Jserver from J then see Help>User Manual>DLLs and
Memory
Management>Calloing J.DLL.

On Tue, Feb 3, 2009 at 6:43 AM, Jack Andrews <[email protected]> wrote:

> i read in file:///C:/j602/help/user/jserver.htm that there should be a
> jep executable -- there isn't one on my windows system.  the first
> example on this page doesn't work:
>
> C:\j602\bin>jconsole.exe
>   require'jserver'
>      js=: conew'jserver'     NB. create new jserver object
>      local__js''                  NB. create J server task
> |no response from J server task: error
> |   y     13!:8[3
>      run__js'abc=: i.2 3 4' NB. run sentence in server task
> |value error: jstate
> |       jstate~:CMDDO
>      d=: get__js'abc'         NB. get value from J server task
> |value error: jstate
> |       jstate~:CMDDO
>      destroy__js''              NB. destroy object and free resources
> 1
>
>
>
> ta, jack
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to