Wrox Home  
 
Search P2P Archive for  go

More Wrox Resources

  Return to Index  

asp_web_howto thread: Referring to Instances of Server Objects


Message #1 by "Chadwick DeVoss" <chad@d...> on Mon, 28 Jan 2002 15:34:11
If I create an object say:



set Telnet1 = Server.CreateObject("Dart.Telnet.1") 



which creates an instance of Dart's telnet component I can then



Telnet1.Connect Hostname

Telnet1.Send Information



If I move to another page, however, I want to be able to refer to that 

open connection.  I can't just say Telnet1.Method, how do I refer to it?
Message #2 by "Alfredo Yong" <alfredo_yong_linux@h...> on Mon, 28 Jan 2002 10:51:38 -0500
It dies when you change to other page. Anything dies when changing to other

page, except session variables. HTML is a stateless protocol, etc. Usually

you don't store objects in server variables: they scale bad.



- Alfredo





=================================================================

Alfredo_Yong@h...

Freelance Developer - Web systems

Expertise in ASP, DHTML, CSS, jscript, php, SQL & etc.

Yes! I'm available to accept any size contracts.



Chadwick DeVoss <chad@d...> escribió en el mensaje de noticias

140225@a..._web_howto...

>

> If I create an object say:

>

> set Telnet1 = Server.CreateObject("Dart.Telnet.1")

>

> which creates an instance of Dart's telnet component I can then

>

> Telnet1.Connect Hostname

> Telnet1.Send Information

>

> If I move to another page, however, I want to be able to refer to that

> open connection.  I can't just say Telnet1.Method, how do I refer to it?

>

>





Message #3 by "Chadwick DeVoss" <chad@d...> on Mon, 28 Jan 2002 16:08:50
Thanks Alfredo,



Is there a way to do what I'm trying to do?

Basically, I have a few telnet sessions that I want to keep open and 

refer to, and use on ASP pages.  I assume the same logic applies to 

having connections to databases and keeping them open and referring to 

them.



Thanks again,



Chad DeVoss



> It dies when you change to other page. Anything dies when changing to 

other

> page, except session variables. HTML is a stateless protocol, etc. 

Usually

> you don't store objects in server variables: they scale bad.

> 

> - Alfredo

> 

> 

> =================================================================

> Alfredo_Yong@h...

> Freelance Developer - Web systems

> Expertise in ASP, DHTML, CSS, jscript, php, SQL & etc.

> Yes! I'm available to accept any size contracts.

> 

> Chadwick DeVoss <chad@d...> escribió en el mensaje de noticias

> 140225@a..._web_howto...

> >

> > If I create an object say:

> >

> > set Telnet1 = Server.CreateObject("Dart.Telnet.1")

> >

> > which creates an instance of Dart's telnet component I can then

> >

> > Telnet1.Connect Hostname

> > Telnet1.Send Information

> >

> > If I move to another page, however, I want to be able to refer to that

> > open connection.  I can't just say Telnet1.Method, how do I refer to 

it?

> >

> >

> 

> 

Message #4 by "Alfredo Yong" <alfredo_yong_linux@h...> on Wed, 30 Jan 2002 12:39:43 -0500
The problem here is that you will have a set of session variables for each

started session. So each time a new user start a session you will have a new

set of session variables. With the right number of started sessions, your

erver will be blocked.



If you can control how many sessions will be open at certain time, then you

could store the telnet objects in session variables. And destroy session

objects when you don't need them anymore.



Once i tryed to store anything in session variables, but my application

hanged when promoted to the server (in my PWS it worked!)



Good luck,







=================================================================

Alfredo_Yong@h...

Freelance Developer - Web systems

Expertise in ASP, DHTML, CSS, jscript, php, SQL & etc.

Yes! I'm available to accept any size contracts.



Chadwick DeVoss <chad@d...> escribió en el mensaje de noticias

140243@a..._web_howto...

>

> Thanks Alfredo,

>

> Is there a way to do what I'm trying to do?

> Basically, I have a few telnet sessions that I want to keep open and

> refer to, and use on ASP pages.  I assume the same logic applies to

> having connections to databases and keeping them open and referring to

> them.

>

> Thanks again,

>

> Chad DeVoss

>

> > It dies when you change to other page. Anything dies when changing to

> other

> > page, except session variables. HTML is a stateless protocol, etc.

> Usually

> > you don't store objects in server variables: they scale bad.

> >

> > - Alfredo

> >

> >

> > =================================================================

> > Alfredo_Yong@h...

> > Freelance Developer - Web systems

> > Expertise in ASP, DHTML, CSS, jscript, php, SQL & etc.

> > Yes! I'm available to accept any size contracts.

> >

> > Chadwick DeVoss <chad@d...> escribió en el mensaje de noticias

> > 140225@a..._web_howto...

> > >

> > > If I create an object say:

> > >

> > > set Telnet1 = Server.CreateObject("Dart.Telnet.1")

> > >

> > > which creates an instance of Dart's telnet component I can then

> > >

> > > Telnet1.Connect Hostname

> > > Telnet1.Send Information

> > >

> > > If I move to another page, however, I want to be able to refer to that

> > > open connection.  I can't just say Telnet1.Method, how do I refer to

> it?

> > >

> > >

> >

> >

>

>





Message #5 by "Ken Schaefer" <ken@a...> on Thu, 31 Jan 2002 11:10:10 +1100
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

: Chadwick DeVoss <chad@d...> escribió en el mensaje de noticias

: 140243@a..._web_howto...

: >

: > Thanks Alfredo,

: >

: > Is there a way to do what I'm trying to do?

: > Basically, I have a few telnet sessions that I want

: > to keep open and refer to, and use on ASP pages.

: > I assume the same logic applies to having connections

: > to databases and keeping them open and referring to

: > them.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Never apply this type of logic to database connections. Always open and

close your connections on every page. Recreate the result-set as required.

Keeping your connections open (and assigned to individual webusers) will

kill the scalability of your website very, very quickly.



Cheers

Ken




  Return to Index