.Net-Smalltalk IPC

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

.Net-Smalltalk IPC

Francesco Raymondi
Hi all,
we need to create communication process for an object’s transfer purpose between a Smalltalk application and a .Net 4 application.
What are the best pratices to do that? (and not involve old style communications like pipeline, text files or db exchange tables).

We have VisualAge Smalltalk 6.0.2.

Thank you very much.

Regards,

Francesco

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: .Net-Smalltalk IPC

SebastianHC
Hi Francesco,

I would have a look at http://zeromq.org/.

This is a networking library it helps you easily setup a nice
distributed environment among your needed software parts.
Unfortunately you might need to implement such support for ZeroMQ.

ZeroMQ just uses ByteArrays as communication medium and this means that
is also up to you how you exchange the real object data.

Here you might have a look at things like message pack or similar object
serialization solutions. It just depends on your needs and wishes.

One thing I like about zeroMQ is that it is very fast, reliable and
support by a vast amount of programming languages.

It is also not that difficult to setup your own memory mapped file
solution. This is also missing in VAST. But it is not that difficult
since the MSDN explains fairly details how to implement it and VAST's OS
layer contains most needed API methods and structures. But this approach
needs more care and knowledge about handling memory. But it works too.

Just my two cents

Sebastian


Am 25.09.2013 02:24, schrieb Francesco Raymondi:

> Hi all,
> we need to create communication process for an object’s transfer
> purpose between a Smalltalk application and a .Net 4 application.
> What are the best pratices to do that? (and not involve old style
> communications like pipeline, text files or db exchange tables).
>
> We have VisualAge Smalltalk 6.0.2.
>
> Thank you very much.
>
> Regards,
>
> Francesco
>
> --
> You received this message because you are subscribed to the Google
> Groups "VA Smalltalk" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [hidden email].
> To post to this group, send email to [hidden email].
> Visit this group at http://groups.google.com/group/va-smalltalk.
> For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: .Net-Smalltalk IPC

nicola mondinelli
are there any ZEROMQ wrapper for VAST already?

Il giorno mercoledì 25 settembre 2013 15:33:34 UTC+2, Sebastian Heidbrink ha scritto:
Hi Francesco,

I would have a look at http://zeromq.org/.

This is a networking library it helps you easily setup a nice
distributed environment among your needed software parts.
Unfortunately you might need to implement such support for ZeroMQ.

ZeroMQ just uses ByteArrays as communication medium and this means that
is also up to you how you exchange the real object data.

Here you might have a look at things like message pack or similar object
serialization solutions. It just depends on your needs and wishes.

One thing I like about zeroMQ is that it is very fast, reliable and
support by a vast amount of programming languages.

It is also not that difficult to setup your own memory mapped file
solution. This is also missing in VAST. But it is not that difficult
since the MSDN explains fairly details how to implement it and VAST's OS
layer contains most needed API methods and structures. But this approach
needs more care and knowledge about handling memory. But it works too.

Just my two cents

Sebastian


Am 25.09.2013 02:24, schrieb Francesco Raymondi:

> Hi all,
> we need to create communication process for an object�s transfer
> purpose between a Smalltalk application and a .Net 4 application.
> What are the best pratices to do that? (and not involve old style
> communications like pipeline, text files or db exchange tables).
>
> We have VisualAge Smalltalk 6.0.2.
>
> Thank you very much.
>
> Regards,
>
> Francesco
>
> --
> You received this message because you are subscribed to the Google
> Groups "VA Smalltalk" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="aorQqe-c0OEJ">va-smalltalk...@googlegroups.com.
> To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="aorQqe-c0OEJ">va-sma...@....
> Visit this group at http://groups.google.com/group/va-smalltalk.
> For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: .Net-Smalltalk IPC

jtuchel
In reply to this post by Francesco Raymondi
Francesco,

there is no .Net - connection product that I am aware of. So what you'll need is some "neutral ground" technology to enable communication between a Smalltalk image and a .Net Application. If you want open standards and easy integration that is possible without much voodoo in VA Smalltalk, you may want to think about simple HTTP requests or, as people call this nowadays, RESTful Web Services. There is no middleware or any other product between your applications and you could even distribute parts of your system over several machines with no extra effort (other than opeing firewall ports).

SST (a framework that ships with VAST) provides all that you need on the Smalltalk side.

Whether REST is suitable fro your needs depends mainly on what exactly needs to be communicated between your applications. But for a lot of cases, REST will allow for a lot of scenarios.

There is a (not-so-current) presentation I gave on RESTful Web Services with VA Smalltalk a few years ago: http://www.objektfabrik.de/Downloads/VASTSummit2009/Tuchel_VAST_RESTfulWS.pdf

I know people have lots of good things to say about ZeroMQ, and it seems to be extremely powerful and performant, but I must admit I have not used it. But it sure sounds like a good alternative!

HTH

Joachim


Am Mittwoch, 25. September 2013 11:24:16 UTC+2 schrieb Francesco Raymondi:
Hi all,
we need to create communication process for an object’s transfer purpose between a Smalltalk application and a .Net 4 application.
What are the best pratices to do that? (and not involve old style communications like pipeline, text files or db exchange tables).

We have VisualAge Smalltalk 6.0.2.

Thank you very much.

Regards,

Francesco

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: .Net-Smalltalk IPC

Marten Feldtmann-2
In reply to this post by Francesco Raymondi
We use JSON for that. Under .NET/Mono we use LitJson and we use UTF-8 as the basic encoding. You may start with a TCP/IP socket connection.

Marten

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: .Net-Smalltalk IPC

Özer DURMAZ
In reply to this post by Francesco Raymondi
The most stable and easy way to communication is using TCP/IP Sockets.
You can also write an Windows System Service (which listens a tcp port) and define it some commands so both two application can communicate via a server program.



25 Eylül 2013 Çarşamba 12:24:16 UTC+3 tarihinde Francesco Raymondi yazdı:
Hi all,
we need to create communication process for an object’s transfer purpose between a Smalltalk application and a .Net 4 application.
What are the best pratices to do that? (and not involve old style communications like pipeline, text files or db exchange tables).

We have VisualAge Smalltalk 6.0.2.

Thank you very much.

Regards,

Francesco

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: .Net-Smalltalk IPC

Özer DURMAZ
A sample socket code for smalltalk:


CONNECTION TO A TCP SERVER
connectTo: hostNameOrNil
        errorBlock: errorBlock
| file hostAddr sockAddr sockRes host connError |
connError := false.
host := hostNameOrNil emptyCoalesce: [ '127.0.0.1' ].
(hostAddr := host inetAddr) = SciSocketErrorCodes::ENOTDOTTEDIP
ifTrue: [ 
" Verilen parametre bir DNS FQDN - DNS lookup yapılacak. "
(host := SciSocketManager default getHostByName: host) isSciError
ifTrue: [ " Hata oluştu "
" burada adres bulunamadı hatası oluşabilir  bu durumda tcphost hata nesnesidir."
connError := true.
file := host. " SciError "
                                                " you can also put an error block "
                                                errorBlock value: self value: file ]
ifFalse: [
hostAddr := host addrList first ].
].
connError ifFalse: [
| islemBlock lastError basarilimi |
islemBlock := [ :port |
" Bağlantı hatasız gerçekleşti. "
(sockAddr := SciSocketAddress family: SciSocketConstants::AFINET)
address: hostAddr;
port: port.
(file := SciSocket newStreamSocket)
blockingFlag: false.
file connect: sockAddr ].
lastError := nil.
basarilimi := false.
self serverPorts do: [ :port |
(basarilimi == true) ifFalse: [
(sockRes := islemBlock callWith: port) isSciError
ifTrue: [ lastError := sockRes ]
ifFalse: [
lastError := nil.
basarilimi := true.
].
].
].
(basarilimi == true) ifFalse: [
file := lastError.
errorBlock notNil: [
errorBlock value: self value: file ].
].
].
^file " returns a SciSocket or a SciError "

READING DATA
readData: buffer
    size: size

                ^file recvAll: buffer length: size startingAt: 1 flags: 0

WRITING (SENDING) DATA
writeData: buffer
     size: size

                ^[ (file sendAll: buffer length: size startingAt: 1 flags: 0)
isSciError not
] when: ExError do: [ :sig | sig exitWith: false ]

CLOSING CONNECTION
disconnect: file

      file close.



6 Ekim 2013 Pazar 22:23:50 UTC+3 tarihinde Özer DURMAZ yazdı:
The most stable and easy way to communication is using TCP/IP Sockets.
You can also write an Windows System Service (which listens a tcp port) and define it some commands so both two application can communicate via a server program.



25 Eylül 2013 Çarşamba 12:24:16 UTC+3 tarihinde Francesco Raymondi yazdı:
Hi all,
we need to create communication process for an object’s transfer purpose between a Smalltalk application and a .Net 4 application.
What are the best pratices to do that? (and not involve old style communications like pipeline, text files or db exchange tables).

We have VisualAge Smalltalk 6.0.2.

Thank you very much.

Regards,

Francesco

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: .Net-Smalltalk IPC

Marten Feldtmann-2
In reply to this post by Francesco Raymondi
Perhaps I should make this more clearer, what should be considered when answering questions like this. I try to summarize our business case:

We have .NET clients, which are exchanging data between each other. We have occasional business events, where we have up to 50 .NET clients talking with each other. A Smalltalk server task is coordinating them - this works pretty stable over the last 5 years.

The Smalltalk server task is receiving domain model changes from the clients and spread this info to all other clients.There is some minor internal logic within the server (mostly file access, storing the transaction information) but mostly tcp/ip communication.

We found out, that the Smalltalk server task (ok, it depends on the server machine speed) is pretty busy (but stable) doing all that IP communication when the number of clients are larger than 30 clients. We are using the TobSocket libraries to implement the IP server logic.

But: TCP/IP communication (under VA) is "slow" is some cases - mostly if you have to exchange only small packages of data between machines. The reason for this performance problem is due to the advanced capability of VA to make future/asynchronous calls. These calls do need much more time than synchronous calls. I found this out - I think - around ten years ago, when I implemented the PostgreSQL Smalltalk library of Visualworks under VA and it was MUCH slower than the VW implementation. VA took around two times more then VW - but VW was blocking and VA was still responsive. When changing the default logic of the EsSockerManager (?) within VA to synchronous calls VA was as fast as VW - but also blocking.

We need both: responsive GUI and speed. We therefore are considering (for us) to put ALL the communication to an external library to take advantage of extra cores to do the communication outside of VA. We found, that ZMQ is a good candidate for *us* in this situation.


--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/groups/opt_out.