Opentalk or remoting libraries

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Opentalk or remoting libraries

Annick
Hi,

Are there some libraries in pharo to do remote calls like in Opentalk or Corba ?

Annick
Reply | Threaded
Open this post in threaded view
|

Re: Opentalk or remoting libraries

S Krish

How about lightweight XMLRPC ? Just for messages, not features around it.

On Wed, Nov 12, 2014 at 10:47 PM, Annick Fron <[hidden email]> wrote:
Hi,

Are there some libraries in pharo to do remote calls like in Opentalk or Corba ?

Annick

Reply | Threaded
Open this post in threaded view
|

Re: Opentalk or remoting libraries

stepharo
In reply to this post by Annick

What is your goal.
There are
     rST (noury uses it in his school)
     Seamless (rewrite of rst nick is working on it).


Stef


> Hi,
>
> Are there some libraries in pharo to do remote calls like in Opentalk or Corba ?
>
> Annick
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Opentalk or remoting libraries

Alain Rastoul-2
In reply to this post by Annick
Hi,
CORBA main focus is about interoperability between systems, languages
(don't know about opentalk).
If you want smalltalk only remote execution, you can very easily do your
own on Pharo with Zinc http components and Fuel serializer: a small
server that reads smalltalk blocks, evaluates them and return the result
(see below an example of server and client).
I don't know if Zinc and Fuel run on Squeak, but I guess if not, they
are equivalents ones or you could do the same.
Beware that Fuel builds a graph of the objects touched by the object it
serializes (the block) and serialize them along the way, that may be a
problem if you have references to other big objects of your image.

" ================================= RPC server"
" start Zn server in background "
ZnServer startDefaultOn: 1701.
ZnServer default delegate: (ZnWebSocketDelegate handler:
                                ([ :webSocket |
                                        [ [ | serializedRequest request response serializedResponse  |
                                                        serializedRequest := webSocket readMessage.
                                                        request := FLMaterializer materializeFromByteArray:
serializedRequest.
                                                        "execute block and it's value to response byte array"
                                                        response := [ request value ]
                                                                  on: Exception do: [ :ex | ex resume: 'Exception ',ex class
name , ' - ', ex messageText ].
                                                        serializedResponse := FLSerializer serializeToByteArray: response .
                                                        webSocket sendMessage: serializedResponse .
                                                ] repeat.
                                         ]
                                        on: ConnectionClosed, ConnectionTimedOut
                                        do: [ self crLog: 'Ignoring connection or timeout' ]
                                ]) ).
"========================================="

" to stop the server"
ZnServer stopDefault .



"========================================= RPC CLIENT"

" Client call to server: calculate factorial 100 on the other side"
| webSocket |
webSocket := ZnWebSocket to: 'ws://127.0.0.1:1701'.
[ | request serializedRequest serializedResponse response |
                request := [  100 factorial ] . " the request is the block to
evaluate"
                serializedRequest := FLSerializer serializeToByteArray: request .
"serialize the block"
                webSocket sendMessage: serializedRequest . "send it"
                serializedResponse := webSocket readMessage . " read response"
                response := FLMaterializer materializeFromByteArray:
serializedResponse. "deserialize to object"
                Transcript show: response asString ; cr  ]
        on: ConnectionClosed
        do: [ self crLog: 'Ignoring connection close, done' ]


regards,

Alain


Le 12/11/2014 18:17, Annick Fron a écrit :
> Hi,
>
> Are there some libraries in pharo to do remote calls like in Opentalk or Corba ?
>
> Annick
>



Reply | Threaded
Open this post in threaded view
|

Re: Opentalk or remoting libraries

Sven Van Caekenberghe-2
Nice.

It is of course also important to note the security risks involved: the client can execute absolutely anything.

One partial solution is to bind the server only to the localhost.

> On 13 Nov 2014, at 19:17, Alain Rastoul <[hidden email]> wrote:
>
> Hi,
> CORBA main focus is about interoperability between systems, languages (don't know about opentalk).
> If you want smalltalk only remote execution, you can very easily do your own on Pharo with Zinc http components and Fuel serializer: a small server that reads smalltalk blocks, evaluates them and return the result (see below an example of server and client).
> I don't know if Zinc and Fuel run on Squeak, but I guess if not, they are equivalents ones or you could do the same.
> Beware that Fuel builds a graph of the objects touched by the object it serializes (the block) and serialize them along the way, that may be a problem if you have references to other big objects of your image.
>
> " ================================= RPC server"
> " start Zn server in background "
> ZnServer startDefaultOn: 1701.
> ZnServer default delegate: (ZnWebSocketDelegate handler:
> ([ :webSocket |
> [ [ | serializedRequest request response serializedResponse  |
> serializedRequest := webSocket readMessage.
> request := FLMaterializer materializeFromByteArray: serializedRequest.
> "execute block and it's value to response byte array"
> response := [ request value ]
> on: Exception do: [ :ex | ex resume: 'Exception ',ex class name , ' - ', ex messageText ].
> serializedResponse := FLSerializer serializeToByteArray: response .
> webSocket sendMessage: serializedResponse .
> ] repeat.
> ]
> on: ConnectionClosed, ConnectionTimedOut
> do: [ self crLog: 'Ignoring connection or timeout' ]
> ]) ).
> "========================================="
>
> " to stop the server"
> ZnServer stopDefault .
>
>
>
> "========================================= RPC CLIENT"
>
> " Client call to server: calculate factorial 100 on the other side"
> | webSocket |
> webSocket := ZnWebSocket to: 'ws://127.0.0.1:1701'.
> [ | request serializedRequest serializedResponse response |
> request := [  100 factorial ] . " the request is the block to evaluate"
> serializedRequest := FLSerializer serializeToByteArray: request . "serialize the block"
> webSocket sendMessage: serializedRequest . "send it"
> serializedResponse := webSocket readMessage . " read response"
> response := FLMaterializer materializeFromByteArray: serializedResponse. "deserialize to object"
> Transcript show: response asString ; cr  ]
> on: ConnectionClosed
> do: [ self crLog: 'Ignoring connection close, done' ]
>
>
> regards,
>
> Alain
>
>
> Le 12/11/2014 18:17, Annick Fron a écrit :
>> Hi,
>>
>> Are there some libraries in pharo to do remote calls like in Opentalk or Corba ?
>>
>> Annick
>>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Opentalk or remoting libraries

Alain Rastoul-2
Le 13/11/2014 20:17, Sven Van Caekenberghe a écrit :
> Nice.
>
> It is of course also important to note the security risks involved: the client can execute absolutely anything.
>
Yes, a problem on open networks.
And important to notice

> One partial solution is to bind the server only to the localhost.
>



Reply | Threaded
Open this post in threaded view
|

Re: Opentalk or remoting libraries

Annick
In reply to this post by Sven Van Caekenberghe-2
Thank you,
My need is on a local network from machine to machine, in real time is possible, so no security involved.
I would have preferred something more performant than web services or XMLRPC, since both serialization and XML serialization are slow.
Annick
Le 13 nov. 2014 à 20:17, Sven Van Caekenberghe <[hidden email]> a écrit :

> Nice.
>
> It is of course also important to note the security risks involved: the client can execute absolutely anything.
>
> One partial solution is to bind the server only to the localhost.
>
>> On 13 Nov 2014, at 19:17, Alain Rastoul <[hidden email]> wrote:
>>
>> Hi,
>> CORBA main focus is about interoperability between systems, languages (don't know about opentalk).
>> If you want smalltalk only remote execution, you can very easily do your own on Pharo with Zinc http components and Fuel serializer: a small server that reads smalltalk blocks, evaluates them and return the result (see below an example of server and client).
>> I don't know if Zinc and Fuel run on Squeak, but I guess if not, they are equivalents ones or you could do the same.
>> Beware that Fuel builds a graph of the objects touched by the object it serializes (the block) and serialize them along the way, that may be a problem if you have references to other big objects of your image.
>>
>> " ================================= RPC server"
>> " start Zn server in background "
>> ZnServer startDefaultOn: 1701.
>> ZnServer default delegate: (ZnWebSocketDelegate handler:
>> ([ :webSocket |
>> [ [ | serializedRequest request response serializedResponse  |
>> serializedRequest := webSocket readMessage.
>> request := FLMaterializer materializeFromByteArray: serializedRequest.
>> "execute block and it's value to response byte array"
>> response := [ request value ]
>> on: Exception do: [ :ex | ex resume: 'Exception ',ex class name , ' - ', ex messageText ].
>> serializedResponse := FLSerializer serializeToByteArray: response .
>> webSocket sendMessage: serializedResponse .
>> ] repeat.
>> ]
>> on: ConnectionClosed, ConnectionTimedOut
>> do: [ self crLog: 'Ignoring connection or timeout' ]
>> ]) ).
>> "========================================="
>>
>> " to stop the server"
>> ZnServer stopDefault .
>>
>>
>>
>> "========================================= RPC CLIENT"
>>
>> " Client call to server: calculate factorial 100 on the other side"
>> | webSocket |
>> webSocket := ZnWebSocket to: 'ws://127.0.0.1:1701'.
>> [ | request serializedRequest serializedResponse response |
>> request := [  100 factorial ] . " the request is the block to evaluate"
>> serializedRequest := FLSerializer serializeToByteArray: request . "serialize the block"
>> webSocket sendMessage: serializedRequest . "send it"
>> serializedResponse := webSocket readMessage . " read response"
>> response := FLMaterializer materializeFromByteArray: serializedResponse. "deserialize to object"
>> Transcript show: response asString ; cr  ]
>> on: ConnectionClosed
>> do: [ self crLog: 'Ignoring connection close, done' ]
>>
>>
>> regards,
>>
>> Alain
>>
>>
>> Le 12/11/2014 18:17, Annick Fron a écrit :
>>> Hi,
>>>
>>> Are there some libraries in pharo to do remote calls like in Opentalk or Corba ?
>>>
>>> Annick
>>>
>>
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Opentalk or remoting libraries

NorbertHartl
Using fuel should be way faster than plain textual serialization. A direct copy of memory would be theoretically faster but you would need to manage references anyway so it is not clear what can be gained.

Norbert
 

> Am 17.11.2014 um 11:05 schrieb Annick Fron <[hidden email]>:
>
> Thank you,
> My need is on a local network from machine to machine, in real time is possible, so no security involved.
> I would have preferred something more performant than web services or XMLRPC, since both serialization and XML serialization are slow.
> Annick
> Le 13 nov. 2014 à 20:17, Sven Van Caekenberghe <[hidden email]> a écrit :
>
>> Nice.
>>
>> It is of course also important to note the security risks involved: the client can execute absolutely anything.
>>
>> One partial solution is to bind the server only to the localhost.
>>
>>> On 13 Nov 2014, at 19:17, Alain Rastoul <[hidden email]> wrote:
>>>
>>> Hi,
>>> CORBA main focus is about interoperability between systems, languages (don't know about opentalk).
>>> If you want smalltalk only remote execution, you can very easily do your own on Pharo with Zinc http components and Fuel serializer: a small server that reads smalltalk blocks, evaluates them and return the result (see below an example of server and client).
>>> I don't know if Zinc and Fuel run on Squeak, but I guess if not, they are equivalents ones or you could do the same.
>>> Beware that Fuel builds a graph of the objects touched by the object it serializes (the block) and serialize them along the way, that may be a problem if you have references to other big objects of your image.
>>>
>>> " ================================= RPC server"
>>> " start Zn server in background "
>>> ZnServer startDefaultOn: 1701.
>>> ZnServer default delegate: (ZnWebSocketDelegate handler:
>>> ([ :webSocket |
>>> [ [ | serializedRequest request response serializedResponse  |
>>> serializedRequest := webSocket readMessage.
>>> request := FLMaterializer materializeFromByteArray: serializedRequest.
>>> "execute block and it's value to response byte array"
>>> response := [ request value ]
>>> on: Exception do: [ :ex | ex resume: 'Exception ',ex class name , ' - ', ex messageText ].
>>> serializedResponse := FLSerializer serializeToByteArray: response .
>>> webSocket sendMessage: serializedResponse .
>>> ] repeat.
>>> ]
>>> on: ConnectionClosed, ConnectionTimedOut
>>> do: [ self crLog: 'Ignoring connection or timeout' ]
>>> ]) ).
>>> "========================================="
>>>
>>> " to stop the server"
>>> ZnServer stopDefault .
>>>
>>>
>>>
>>> "========================================= RPC CLIENT"
>>>
>>> " Client call to server: calculate factorial 100 on the other side"
>>> | webSocket |
>>> webSocket := ZnWebSocket to: 'ws://127.0.0.1:1701'.
>>> [ | request serializedRequest serializedResponse response |
>>> request := [  100 factorial ] . " the request is the block to evaluate"
>>> serializedRequest := FLSerializer serializeToByteArray: request . "serialize the block"
>>> webSocket sendMessage: serializedRequest . "send it"
>>> serializedResponse := webSocket readMessage . " read response"
>>> response := FLMaterializer materializeFromByteArray: serializedResponse. "deserialize to object"
>>> Transcript show: response asString ; cr  ]
>>> on: ConnectionClosed
>>> do: [ self crLog: 'Ignoring connection close, done' ]
>>>
>>>
>>> regards,
>>>
>>> Alain
>>>
>>>
>>> Le 12/11/2014 18:17, Annick Fron a écrit :
>>>> Hi,
>>>>
>>>> Are there some libraries in pharo to do remote calls like in Opentalk or Corba ?
>>>>
>>>> Annick
>>>>
>>>
>>>
>>>
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Opentalk or remoting libraries

Alain Rastoul-2
In reply to this post by Annick
For a machine to machine connection, there will be no direct memory
reference but under the hood some socket connection with a tcp server
and client, and some marshalling of arguments that is to say some
serialization.
I'm not sure it would be really faster than websocket and Fuel, because
it will be a generic api that have to be able to deal with complex cases.
I don't see xml and webservice here ?

Le 17/11/2014 11:05, Annick Fron a écrit :

> Thank you,
> My need is on a local network from machine to machine, in real time is possible, so no security involved.
> I would have preferred something more performant than web services or XMLRPC, since both serialization and XML serialization are slow.
> Annick
> Le 13 nov. 2014 à 20:17, Sven Van Caekenberghe <[hidden email]> a écrit :
>
>> Nice.
>>
>> It is of course also important to note the security risks involved: the client can execute absolutely anything.
>>
>> One partial solution is to bind the server only to the localhost.
>>
>>> On 13 Nov 2014, at 19:17, Alain Rastoul <[hidden email]> wrote:
>>>
>>> Hi,
>>> CORBA main focus is about interoperability between systems, languages (don't know about opentalk).
>>> If you want smalltalk only remote execution, you can very easily do your own on Pharo with Zinc http components and Fuel serializer: a small server that reads smalltalk blocks, evaluates them and return the result (see below an example of server and client).
>>> I don't know if Zinc and Fuel run on Squeak, but I guess if not, they are equivalents ones or you could do the same.
>>> Beware that Fuel builds a graph of the objects touched by the object it serializes (the block) and serialize them along the way, that may be a problem if you have references to other big objects of your image.
>>>
>>> " ================================= RPC server"
>>> " start Zn server in background"
>>> ZnServer startDefaultOn: 1701.
>>> ZnServer default delegate: (ZnWebSocketDelegate handler:
>>> ([ :webSocket |
>>> [ [ | serializedRequest request response serializedResponse  |
>>> serializedRequest := webSocket readMessage.
>>> request := FLMaterializer materializeFromByteArray: serializedRequest.
>>> "execute block and it's value to response byte array"
>>> response := [ request value ]
>>> on: Exception do: [ :ex | ex resume: 'Exception ',ex class name , ' - ', ex messageText ].
>>> serializedResponse := FLSerializer serializeToByteArray: response .
>>> webSocket sendMessage: serializedResponse .
>>> ] repeat.
>>> ]
>>> on: ConnectionClosed, ConnectionTimedOut
>>> do: [ self crLog: 'Ignoring connection or timeout' ]
>>> ]) ).
>>> "========================================="
>>>
>>> " to stop the server"
>>> ZnServer stopDefault .
>>>
>>>
>>>
>>> "========================================= RPC CLIENT"
>>>
>>> " Client call to server: calculate factorial 100 on the other side"
>>> | webSocket |
>>> webSocket := ZnWebSocket to: 'ws://127.0.0.1:1701'.
>>> [ | request serializedRequest serializedResponse response |
>>> request := [  100 factorial ] . " the request is the block to evaluate"
>>> serializedRequest := FLSerializer serializeToByteArray: request . "serialize the block"
>>> webSocket sendMessage: serializedRequest . "send it"
>>> serializedResponse := webSocket readMessage . " read response"
>>> response := FLMaterializer materializeFromByteArray: serializedResponse. "deserialize to object"
>>> Transcript show: response asString ; cr  ]
>>> on: ConnectionClosed
>>> do: [ self crLog: 'Ignoring connection close, done' ]
>>>
>>>
>>> regards,
>>>
>>> Alain
>>>
>>>
>>> Le 12/11/2014 18:17, Annick Fron a écrit :
>>>> Hi,
>>>>
>>>> Are there some libraries in pharo to do remote calls like in Opentalk or Corba ?
>>>>
>>>> Annick
>>>>
>>>
>>>
>>>
>>
>>
>
>
>