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 

TIdTCPClient/Server - Read/Write at same time?

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





PostPosted: Tue May 08, 2007 8:12 am    Post subject: TIdTCPClient/Server - Read/Write at same time? Reply with quote



Hi - This is a real quickie

Can the TIdTCPClient/Server read and write at the same time?

IE my Client has a reading thread (To avoid Antifreeze) BUT can it also
write at the very sam time as reading?
EG
//While Client is reading Stream (EG large file) can it write back out?
IdTCPClient1.WriteLine('anything goes while reading');

Same question applies to the TIdTCPServer too please..

Am I ok to write at the same time as reading or must I also incorporate a
data queue?

Sorry in advance if it's a dumb question..
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Wed May 09, 2007 12:01 am    Post subject: Re: TIdTCPClient/Server - Read/Write at same time? Reply with quote



"Jamie Dale" <jamie.dale (AT) yahoo (DOT) com> wrote:

Quote:
my Client has a reading thread (To avoid Antifreeze)
BUT can it also write at the very sam time as reading?

Yes. A socket has separate buffers for inbound and outbound data. It is safe to read in one thread while another thread is writing. Just do not read from multiple threads, or write from multiple threads, at the same time. That would not be safe.


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.