From: Robert Klemme Date: 2013-06-05T23:55:11+09:00 Subject: Re: TCPServer/Socket and Marshal problem --001a11c3d73c5a40c204de696253 Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable On Wed, Jun 5, 2013 at 3:27 PM, Panagiotis Atmatzidis wrote: > > On 5 =C9=EF=F5=ED 2013, at 14:53 , Robert Klemme > wrote: > > > > > On Wed, Jun 5, 2013 at 12:56 PM, Panagiotis Atmatzidis < > atma@convalesco.org> wrote: > >> >> On 5 =C9=EF=F5=ED 2013, at 12:08 , Robert Klemme >> wrote: >> >> TCPServer/Socket seems a lot cleaner + I have the chance of learning one >> thing or two about how a client/server app works at this level. Since >> time is not an issue and learning as much as possible on the process is = one >> of the goals, all I need to do (in my case) is ti implement 'MuTex' and >> handle TCPServer/Socket connection errors in a graceful way and I'm on. >> >> >> Fair enough. What is your application supposed to do? >> >> >> Client auth's to the server, using just an string. If auth successfully >> client requests an object, performs actions and returns an object with >> results of these actions. Both objects are arrays (text). >> > > And where in that scenario is the server issuing requests towards the > client? I only see > > > client connects and obtains entry object > client invokes session =3D entry.authenticate(credentials) > server returns session object (if auth successful) > client invokes data =3D session.get_whatever_i_need() > client invokes result =3D data.do_the_work() (locally) > client invokes session.the_result_is(result) > > client invokes session.close (optional) > > > You mean this code is possible? https://gist.github.com/atmosx/5713828 (l= ook > at the run method) > Line 7 is superfluous for the client. Oh, and btw. variable "any" in #initialize is pretty useless. Did you mean "@any"? > So the client can dump the results to the remote database? Or pass it to > the server to make the check ups and then dump it to the database? > Of course. Why should it not? > I missed that part :-P if that's the case. > DRb is a complete distributed object communication system. You have value and reference objects (see DRb::DRbUndumped). Cheers robert --=20 remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ --001a11c3d73c5a40c204de696253 Content-Type: text/html; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable



On Wed, Jun 5, 2013 at 3:27 PM, Panagiotis Atmatzidis <atma@conv= alesco.org> wrote:

On 5 =C9=EF=F5=ED 2013, at 14:53 , Robert Klemme <shortcutter@googlemail.com> wrote:




On Wed, Jun 5, 2013 at 12:56 PM, Panagio= tis Atmatzidis <atma@convalesco.org> wrote:

On = 5 =C9=EF=F5=ED 2013, at 12:08 , Robert Klemme <shortcutter@googlemail.com> w= rote:

TCPServer/Socket seems a lot= cleaner + I have the chance of learning one thing or two about how a clien= t/server app works at this level. Since time=A0is not an issue and learning= as much as possible on the process is one of the goals, all I need to do (= in my case) is ti implement 'MuTex' and handle TCPServer/Socket=A0c= onnection errors in a graceful way and I'm on.
=
Fair enough. =A0What is your application supposed to do?

Client auth's to the server, using = just an string. If auth successfully client requests an object, performs ac= tions and returns an object with results of these actions. Both objects are= arrays (text).

And where in = that scenario is the server issuing requests towards the client? =A0I only = see

client connects and obtains entry object
cl= ient invokes session =3D entry.authenticate(credentials)
server returns session object (if auth successful)
client invokes data =3D session.get_whatever_i_n= eed()
client invokes result =3D data.do_the= _work() (locally)
client invokes session.th= e_result_is(result)
client invokes session.close (optional)

You mean this code is possi= ble?=A0https://gist.github.com/atmosx/5713828=A0(look at the run method)

Line 7 is superfluous fo= r the client. =A0Oh, and btw. variable "any" in #initialize is pr= etty useless. =A0Did you mean "@any"?
=A0
S= o the client can dump the results to the remote database? Or pass it to the= server to make the check ups and then dump it to the database?

Of course. =A0Why should= it not?
=A0
I missed that part :-P if tha= t's the case.=A0

DRb is a complete distributed object communication system. =A0You hav= e value and reference objects (see DRb::DRbUndumped).

Cheers

robert


--
remember.guy do = |as, often| as.you_can - without end
http://blog.rubybestpractices.com/ --001a11c3d73c5a40c204de696253--