You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by f2t <fe...@gmail.com> on 2008/08/07 23:17:51 UTC

Question about IoSession.write()

Hi

Small question...

If i do IoSession.write("something").join();
IoSession.write("something2");  where each IoSession is from a
different SocketConnector but connected to the same server, is
something guaranteed to reach the server before something2? Assume
these two method calls would be running in the same thread.

Thank you

Re: Question about IoSession.write()

Posted by Tuure Laurinolli <tu...@indagon.com>.
Mark Webb wrote:
> If the 2 session represent different connections, then I would agree.

They do. He originally stated this on IRC, but the way the question was 
stated initially led me astray too. The mixup was cleared eventually.

>>> On Thu, Aug 7, 2008 at 5:17 PM, f2t <fe...@gmail.com> wrote:
>>>> If i do IoSession.write("something").join();
>>>> IoSession.write("something2");  where each IoSession is from a

I would've written "session1.write("foo").join(); and 
session2.write("bar");". It's much clearer for me at least.

Re: Question about IoSession.write()

Posted by Mark Webb <el...@gmail.com>.
If the 2 session represent different connections, then I would agree.

On Fri, Aug 8, 2008 at 11:24 AM, f2t <fe...@gmail.com> wrote:

> Hi
>
> My results show something2 can arrive first.
>
> As explained to me by tazzle on the IRC channel, this is because there
> are two connections (TCP/IP in my case), so there is no guarantee of
> order in which the OS will send the messages.
>
> Just to let you know.
>
> On Fri, Aug 8, 2008 at 3:52 AM, Mark Webb <el...@gmail.com> wrote:
> > I would say yes.  Did you test this and what were your results?
> >
> >
> > On Thu, Aug 7, 2008 at 5:17 PM, f2t <fe...@gmail.com> wrote:
> >
> >> Hi
> >>
> >> Small question...
> >>
> >> If i do IoSession.write("something").join();
> >> IoSession.write("something2");  where each IoSession is from a
> >> different SocketConnector but connected to the same server, is
> >> something guaranteed to reach the server before something2? Assume
> >> these two method calls would be running in the same thread.
> >>
> >> Thank you
> >>
> >
>

Re: Question about IoSession.write()

Posted by f2t <fe...@gmail.com>.
Hi

My results show something2 can arrive first.

As explained to me by tazzle on the IRC channel, this is because there
are two connections (TCP/IP in my case), so there is no guarantee of
order in which the OS will send the messages.

Just to let you know.

On Fri, Aug 8, 2008 at 3:52 AM, Mark Webb <el...@gmail.com> wrote:
> I would say yes.  Did you test this and what were your results?
>
>
> On Thu, Aug 7, 2008 at 5:17 PM, f2t <fe...@gmail.com> wrote:
>
>> Hi
>>
>> Small question...
>>
>> If i do IoSession.write("something").join();
>> IoSession.write("something2");  where each IoSession is from a
>> different SocketConnector but connected to the same server, is
>> something guaranteed to reach the server before something2? Assume
>> these two method calls would be running in the same thread.
>>
>> Thank you
>>
>

Re: Question about IoSession.write()

Posted by Mark Webb <el...@gmail.com>.
I would say yes.  Did you test this and what were your results?


On Thu, Aug 7, 2008 at 5:17 PM, f2t <fe...@gmail.com> wrote:

> Hi
>
> Small question...
>
> If i do IoSession.write("something").join();
> IoSession.write("something2");  where each IoSession is from a
> different SocketConnector but connected to the same server, is
> something guaranteed to reach the server before something2? Assume
> these two method calls would be running in the same thread.
>
> Thank you
>