bpayne111 Posted December 22, 2003 Posted December 22, 2003 i'm following the example in a book and i have these variables defined public class User { internal Socket _connection; //why is this internal private Thread _readThread; private NetworkStream _socketStream; private BinaryWriter _writer; private BinaryReader _reader; } my question is why is _connection internal instead of private? i do not notice any other parts of my application using _connection so it would seem private is ok. Does the threading have something to do with this? thanks brandon Quote i'm not lazy i'm just resting before i get tired.
Administrators PlausiblyDamp Posted December 22, 2003 Administrators Posted December 22, 2003 Does this class get used later on in the book, if so this could be planning ahead. If so variables marked as internal can be accessed by any code in the same assembly (project) but not outside the assembly. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vclrfinternalpg.asp Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
*Gurus* Derek Stone Posted December 22, 2003 *Gurus* Posted December 22, 2003 It is clearly a very poorly designed class. Quote Posting Guidelines
bpayne111 Posted December 22, 2003 Author Posted December 22, 2003 yes derek i think you are right. I took the concept provided and added my oop knowledge to it to create a Server component and now it all made sense. Thanks brandon Quote i'm not lazy i'm just resting before i get tired.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.