What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » C# anyone?

C# anyone?
Author: Message:
Chancer
Senior Member
****

Avatar

Posts: 648
Reputation: 7
35 / Male / Flag
Joined: May 2005
Status: Away
O.P. C# anyone?
I'm starting to learn C# (by my own, so far, with a teacher soon).
I'd like to create a linked list able to store 2 variables.

I'm working with TCP connections, and one of these variables is obviously the client socket, which is the only one I'm storing right now:
C# code:
private LinkedList<Socket> list = new LinkedList<Socket>();
I also want to store a string, representing the client name, for example.
Is that possible?

I thought of creating a new structure ("transcoding" what I learned on C), but I'd need to use pointers, and I read somewhere C# has no pointers...

Edit: reading the reference on MSDN I found a Dictionary. Do you think replacing the linked list by the dictionary would work?
The methods I need are Add, RemoveFirst, Cound and I also use:
C# code:
foreach(Socket s in list) //cmd

I'm afraid it's not possible due to this:
C# code:
while (list.Count != 0) list.RemoveFirst(); // this is using LinkedList
I don't think I can remove one element without telling which on, right?

This post was edited on 06-25-2011 at 01:45 AM by Chancer.
06-25-2011 01:32 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
C# anyone? - by Chancer on 06-25-2011 at 01:32 AM
RE: C# anyone? - by Mnjul on 06-25-2011 at 09:43 AM
RE: C# anyone? - by Chancer on 06-25-2011 at 04:39 PM
RE: C# anyone? - by Adeptus on 06-28-2011 at 04:08 AM
RE: C# anyone? - by Chancer on 06-28-2011 at 07:18 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On