Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

i'm not lazy i'm just resting before i get tired.
  • Administrators
Posted

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

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

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

i'm not lazy i'm just resting before i get tired.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...