BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

streaming a object?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Tony Caduto
Guest





PostPosted: Wed Jan 21, 2004 11:23 pm    Post subject: streaming a object? Reply with quote



Is it possible to stream a tobject with Indy?
If so does anyone have a example?

Thanks,
--
Tony


Back to top
Chad Z. Hower aka Kudzu
Guest





PostPosted: Wed Jan 21, 2004 11:48 pm    Post subject: Re: streaming a object? Reply with quote



"Tony Caduto" <acaduto (AT) amsoftwaredesign (DOT) com> wrote in news:400f09e2$1
@newsgroups.borland.com:
Quote:
Is it possible to stream a tobject with Indy?
If so does anyone have a example?

Just use Delphi's streamning fucntions which stream to text, then write it
accross to Indy.


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Want more Indy stuff? Try the Atozed Indy Portal at
http://www.atozedsoftware.com/
* More Free Demos
* Free Articles
* Extra Support


ELKNews - Get your free copy at http://www.atozedsoftware.com


Back to top
Eugene Mayevski [SecureBl
Guest





PostPosted: Thu Jan 22, 2004 12:54 am    Post subject: Re: streaming a object? Reply with quote



Chad Z. Hower aka Kudzu wrote:

Quote:
Is it possible to stream a tobject with Indy?
If so does anyone have a example?
Just use Delphi's streamning fucntions which stream to text, then write it
accross to Indy.

Delphi streaming works only with TPersistent (this is what TPersistent
is for). If one wants to stream something else, he needs to write his
own serialization mechanism. Not very hard, I think, but only for
TPersistent. For TObject it might be harder.

--
Eugene Mayevski
EldoS Corp., CTO
Security and networking solutions
http://www.eldos.com


Back to top
Dennis Landi
Guest





PostPosted: Thu Jan 22, 2004 3:21 am    Post subject: Re: streaming a object? Reply with quote

"Eugene Mayevski [SecureBlackbox]" <mayevski (AT) eldos (DOT) org> wrote

Quote:
Chad Z. Hower aka Kudzu wrote:

Is it possible to stream a tobject with Indy?
If so does anyone have a example?
Just use Delphi's streamning fucntions which stream to text, then write
it
accross to Indy.

Delphi streaming works only with TPersistent (this is what TPersistent
is for). If one wants to stream something else, he needs to write his
own serialization mechanism. Not very hard, I think, but only for
TPersistent. For TObject it might be harder.


Tony, I'd recommend going the RTTI route and only pack/unpacking the
properties you need.

I believe http://www.bigattichouse.com has a freeware RTTI to XML to RTTI
component that you can examine to see how its done....

As Eugene points, out tPersistent has ready made has RTTI facilities to do
this. The TypInfo.pas unit is pretty easy to read....

-d



Back to top
Tony Caduto
Guest





PostPosted: Thu Jan 22, 2004 3:36 pm    Post subject: Re: streaming a object? Reply with quote

I have to go through all that to stream a simple tobject?
why can't I just do a writebuffer(myobject, sizeof(myobject))
isn't a object just a junk of memory?


--
Tony Caduto
AM Software Design
Inexpensive Corporate Instant Messaging
http://www.amsoftwaredesign.com

"Dennis Landi" <none[at]none.com> wrote

Quote:
"Eugene Mayevski [SecureBlackbox]" <mayevski (AT) eldos (DOT) org> wrote in message
news:400f1f6f (AT) newsgroups (DOT) borland.com...
Chad Z. Hower aka Kudzu wrote:

Is it possible to stream a tobject with Indy?
If so does anyone have a example?
Just use Delphi's streamning fucntions which stream to text, then
write
it
accross to Indy.

Delphi streaming works only with TPersistent (this is what TPersistent
is for). If one wants to stream something else, he needs to write his
own serialization mechanism. Not very hard, I think, but only for
TPersistent. For TObject it might be harder.


Tony, I'd recommend going the RTTI route and only pack/unpacking the
properties you need.

I believe http://www.bigattichouse.com has a freeware RTTI to XML to RTTI
component that you can examine to see how its done....

As Eugene points, out tPersistent has ready made has RTTI facilities to do
this. The TypInfo.pas unit is pretty easy to read....

-d





Back to top
Chad Z. Hower aka Kudzu
Guest





PostPosted: Thu Jan 22, 2004 4:21 pm    Post subject: Re: streaming a object? Reply with quote

"Tony Caduto" <acaduto (AT) amsoftwaredesign (DOT) com> wrote in news:400fee05$1
@newsgroups.borland.com:
Quote:
I have to go through all that to stream a simple tobject?

If its from TPersistent or down just use the built in streaming, its really
easy.

Quote:
why can't I just do a writebuffer(myobject, sizeof(myobject))
isn't a object just a junk of memory?

Yes, with local references and even out of object references that wont make
any sense. Also you'll get just the pointer with the above. :)


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Need extra help with an Indy problem?

http://www.atozed.com/indy/experts/support.html


ELKNews - Get your free copy at http://www.atozedsoftware.com


Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu Jan 22, 2004 8:18 pm    Post subject: Re: streaming a object? Reply with quote


"Tony Caduto" <acaduto (AT) amsoftwaredesign (DOT) com> wrote


Quote:
I have to go through all that to stream a simple tobject?

Yes.

Quote:
why can't I just do a writebuffer(myobject, sizeof(myobject))

That wouldn't work if the object contained pointers or other dynamic
content.

Quote:
isn't a object just a junk of memory?

It is more involved than that.


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.