From: Robert Klemme Date: 2013-06-05T21:53:27+09:00 Subject: Re: TCPServer/Socket and Marshal problem --001a11c30b18055aec04de67af61 Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable On Wed, Jun 5, 2013 at 12:56 PM, Panagiotis Atmatzidis wrote: > > On 5 =C9=EF=F5=ED 2013, at 12:08 , Robert Klemme > wrote: > > > > > On Wed, Jun 5, 2013 at 10:54 AM, Panagiotis Atmatzidis < > atma@convalesco.org> wrote: > > >> Second approach was DRuby, but you can't have bi-directional >> communication in DRuby without turning the client into a server, which >> requires opening another port and this in a real-case scenario won't cut= it >> for me. >> > > That depends on how you set it up: if avoiding that other port is so > important you could have a queue on client side which is read from the > server in an endless loop. Whenever the queue is empty the call blocks. > Yeah, I know, ugly workaround. > > > I spent two days trying to find a *normal way* to return the object to th= e > server. Didn't see that sort of solution nowhere online. > Are you saying you need an example to implement that? > 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) Cheers robert --=20 remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ --001a11c30b18055aec04de67af61 Content-Type: text/html; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable



On Wed, Jun 5, 2013 at 12:56 PM, Panagiotis Atmatzidis <atma@con= valesco.org> wrote:

On 5 =C9=EF=F5=ED 2013, at 12:08 , Robert Klemme &l= t;shortcutt= er@googlemail.com> wrote:




On Wed, Jun 5, 2013 at 10:54 AM, Pana= giotis Atmatzidis <atma@convalesco.org> wrote:
=A0
Second approach was DRuby, but you can't have=A0bi-direction= al communication in DRuby without turning the client into a server, which r= equires opening another port and this in a real-case scenario=A0won't c= ut it for me.

That depends on how you set it up: i= f avoiding that other port is so important you could have a queue on client= side which is read from the server in an endless loop. =A0Whenever the que= ue is empty the call blocks. =A0Yeah, I know, ugly workaround.

I spent two days t= rying to find a *normal way* to return the object to the server. Didn't= see that sort of solution nowhere online.

Are you saying you need an example to implement t= hat?
=A0
TCPServer/Socket seems a lot cleaner + I have the chance of learning o= ne thing or two about how a client/server app works at this level. Since ti= me=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=A0connection errors in a graceful way and I&#= 39;m on.

Fair enough. =A0What is your application suppo= sed to do?

Client auth= 9;s to the server, using just an string. If auth successfully client reques= ts 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? =A0I 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_whatev= er_i_need()
client invokes result =3D= data.do_the_work() (locally)
client = invokes session.the_result_is(result)
client invokes session.close (optional)

Cheers

robert<= br clear=3D"all">

--
remember.guy do |as, often| as.you_can - without end<= br>http://blog.rubybestpract= ices.com/
--001a11c30b18055aec04de67af61--