Re: Splitting a full-duplex socket

From: Rene (invalid_at_email.addr)
Date: 01/07/05


Date: 06 Jan 2005 23:38:23 GMT


"cyberco" <cyberco@gmail.com> wrote:
> Rene wrote:
> > "cyberco" <cyberco@gmail.com> wrote:
> > [snip]
> > > I did (and still do) not know whether that simple solution would
> work
> > > and what the optimal solution would be (should I simply use an
> > > InputStream? Or a ByteArrayInputStream? How many bytes should I
> read?
> > > Etcetera.) That's why I asked for some advice here. But to
> illustrate
> > > what my situation was I said that I needed it for a mobile phone
> that
> > > doesn't support full-duplex sockets to communicate with a
> server-side
> > > application that ONLY accepts full-duplex sockets. That got most of
> the
> > > responders off into the wrong direction. Many got confused by
> reading
> > > about devices not supporting full-duplex sockets.
> > >
> > > Anyway, in the meantime I implemented a proxy that reads and
> forwards
> > > characters (using seperate threads). It seems to work inside the
> proxy,
> > > but it might not be an optimal solution :( The client side still
> > > doesn't work though. I'll keep debugging.
> > > I apologize to everybody here I might have confused.
> >
> > And which mobile phone would that be?
>
> See a list here:
> http://www.google.nl/search?q=cache:dEnCQxc5x_UJ:www.funrungames.com/midp
> 2.html+midp+duplex+socket&hl=en cyberco

Uh is that your site? I'm asking because it does not look very
authoritative on the problem at hand. It says that it will work on the
Nokia but not on the Sony Ericsson P900.

I think I know now what you are trying to say. On J2ME, it is not mandatory
under the MIDLET 1 specification to provide the Socket class for arbitrary
sockets. However it is mandatory to support HTTP-Connections. So in order
to circumvent this limitation you create a HTTP proxy which takes this
HTTP-Connection from the phone, create a normal socket on the proxy etc.

What you were baffling us all with if I see this scenario correct is simply
that this HTTP connection *is* full duplex, however you cannot access and
use it in the same way as a normal socket. Full duplex means you can send
and receicve and HTTP absolutely requires this (send header, receive
result). But you kept saying you had no Full-duplex connection, which is
quite simply wrong - and very puzzling too. It would mean you could only
send or receive per connection, so that you would need two connections for
full-duplex on the phone. And I'm pretty sure that this is not the case.

MIDP2 defines socket which is probably what you'd like to have. But if not,
and MIDP1 does not define them, then some sort of application proxy on a
WAP-gateway is the way to go. Never the less, what you're having is one
full-duplex socket, because you use it for reading from the phone and
writing data to the phone. It may be that you use several since HTTP is
stateless and generally does one connection per request ("send cycle", if
you want) but maybe you can force it in the non-closing mode where after a
request got sent it will not close the connection but stay open (NPH).
Don't know if the feature is there, I don't do MIDLETs. Anyway, back to the
original question: What is the best way to do it ? My answer is, it depends
a lot on the protocol on the other side of the proxy. It may be very easy
to map it onto the HTTP stream or damn difficult. What type of protocol is
there?

CU

Rene

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


Relevant Pages

  • Re: Internet Connection Error
    ... Running RSOP gives me the expected results (correct proxy settings etc). ... Running Firefox as the same user lets me connect the the internet through ... HTTP, HTTPS, FTP Diagnostic ... warn HTTP: Error 12029 connecting to www.hotmail.com: A connection with the ...
    (microsoft.public.windowsxp.security_admin)
  • HTTPConnection and 1.0 vs. 1.1
    ... I have questions regarding the J2ME/MIDP connection manager HTTPConnection ... tearing down a socket over the mobile network is something I can see I'd ... - The HTTP request seems to be actaully sent when I try and open the ...
    (comp.lang.java.programmer)
  • Re: Who should close and when?
    ... Well, that means it's a one shot socket, like HTTP 1.0. ... If i send then close the connection my server loses its connection, ...
    (microsoft.public.win32.programmer.networks)
  • Tunneling all connections through http
    ... Did any of you manage to tunnel all the connection through a http ... I managed to use my http proxy instead of the t-mobile's but ...
    (microsoft.public.pocketpc)
  • RE: Getting HTTP 400 errors with multithreaded webservice calls through an authenticating ISA proxy
    ... comming fron the wed server back through the proxy. ... When I Sniff the connections I can see that the http message that is ... The issue seems to be that when an existing authenticated connection ... authentication but over the first connection that is already ...
    (microsoft.public.dotnet.framework.webservices)