Re: Applet Consideration
From: Yamin (absdfsd_at_sdfdasfsd.com)
Date: 03/17/04
- Next message: Ike: "Re: Basic Question about DELETE"
- Previous message: Anton Nemychenkov: "Oracle JDBC driver exception "Stream has already been closed""
- In reply to: Yamin: "Re: Applet Consideration"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 16 Mar 2004 20:17:27 -0500
Nevermind that. I was beign stupid.
the paramters passed into socket.connect work fine. You just can't use the
same address to type into the web browser...that's okay for me ;)
Yamin
"Yamin" <absdfsd@sdfdasfsd.com> wrote in message
news:udM5c.4645$Eb6.175790@news20.bellglobal.com...
> Hi guys,
>
> this is prolly not JDBC specific, but I'm getting good advice here, so I
> figured I'd try since its part of the same applcation.
>
> Basically, given the setup below, one of the tricky things I'm running
into
> has to do with what parameters do I supply to Socket.connect(host, port)
for
> the client applet to connect to the server.
>
> 1. My computer(the server) is behind a router
> 2. I've setup the router to do port forwarding for HTTP connection(port
80)
> to my local apache server (port 80)
> 3. I've setup the router to do port forwarding for my server app (port
> 10000) to my local server app(port 10000)
>
> if I'm running the applet on the local network, I simply set the host to
be
> my local computers name (PC_YAMIN).
> if I'm accessing remotely, I set the host to be the WAN ip address of the
> gateway
> Using either of these methods, everything works nicely.
>
> What I can't seem to have happen is to have a single host variable which
> works for both LAN and WAN. If I use the WAN address while trying to
access
> the applet locally, it says TIMED OUT WHILE TRYING TO CONNECT to WAN_IP.
>
> Any ideas?
>
> Thanks
>
>
> Yamin
>
>
>
>
> "Yamin" <absdfsd@sdfdasfsd.com> wrote in message
> news:y3M5c.4484$Eb6.175056@news20.bellglobal.com...
> > Okie guys,
> >
> > Having just went through the learning experience of sorts...this is what
I
> > did.
> >
> > I have essentially 2 application
> > 1. Applet
> > 2. Server
> >
> > Applet (Client)
> > Has all the GUI code and what not. As I said, it was suprisingly easy
to
> > convert my standard application to an applet. I then created
clientstubs
> > for any database access application
> > i.e. boolean login(String domain, String user, String pass)
> >
> > I used a really cheap protocol, as the data being sent is just Strings
and
> > some ints.
> > Basically, everything is sent as String. One String per line so
functions
> > like readline() can work nicely.
> >
> > *************************************
> > Client request consists of:
> > Command String (i.e. "LOGIN" )
> > param1 String
> > ...
> > paramn String
> >
> > Server replies consist of
> > result string( i.e "PASS" or "FAIL" )
> > return1 String
> > ....
> > return paramn String
> > *************************************
> >
> > I made it so the client has absolutely no knowledge that the db exists.
> > Otherwise, I'd have to grant access to the client to hold locks and what
> > not, which I did not want to give for security reasons. To the client,
> > everything looks like a function call (w/th some remote method type
stuff)
> >
> > Server (runs on the same machine as the webserver/database...)
> > The server listens on a port and starts server threads for each new
> > connection. Each thread must be initialized by a login. This login
open
> a
> > connection to the database. I did it this way, so in case a thread goes
> > broke or someting, any locks on tables, transaction will behave nicely
and
> > the user can't preform any operations without login in correctly first.
> > *************************************
> >
> > Things I might have done differently:
> >
> > 1. I really wanted to use SSL to encrpypt the connection. This way,
> login
> > passwords and other data could be transferred nicely. I read through
the
> > docs samples and what not, but just decided against it as I didn't want
to
> > add any more things that I really didn't understand.
> >
> > And it seems to work quite well. I tested it both locally and remotely.
> It
> > all seems nice ;) Sure, it might have been nice to learn PHP and what
not
> > (it got really tempting last night), but I already did a lot of work on
> this
> > in Java, so such is such.
> >
> > Yamin
> >
> >
> >
>
>
- Next message: Ike: "Re: Basic Question about DELETE"
- Previous message: Anton Nemychenkov: "Oracle JDBC driver exception "Stream has already been closed""
- In reply to: Yamin: "Re: Applet Consideration"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|