![]() |
| | #1 |
| Registered User Join Date: Mar 2009
Posts: 21
| c# array |
| Mastermosley is offline | |
| | #2 |
| Registered User Join Date: Jun 2008 Location: RING 0
Posts: 468
| Make a class with the information you needed and then add it to a list. Otherwise to make a new array of your class it would be something like: Code: yourClass[] Something = new yourClass[SIZE](); |
| valaris is offline | |
| | #3 |
| and the Hat of Ass Join Date: Dec 2007
Posts: 813
| Might I suggest you learn the basics of the C# language before you try to write a server? |
| rags_to_riches is offline | |
| | #4 |
| Registered User Join Date: Mar 2009 Location: england
Posts: 95
| Rags is correct. You need to have at least a basic understanding of OOP. From the criteria you've listed, I would make an object such as: Code: class UserObject
{
public Socket socket;
public IPAddress ip;
public StreamReader reader;
public StreamWriter writer;
public UserObject() { }
public UserObject(Socket socket)
{
this.socket = socket;
this.ip = ((IPEndPoint)socket.RemoteEndPoint).Address;
this.reader = new StreamReader(new NetworkStream(socket));
this.writer = new StreamWriter(new NetworkStream(socket));
}
}
Code: List<UserObject> my_users = new List<UserObject>(); |
| theoobe is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| allocation and reallocation of memory dynamically of an integer array | zamir | C++ Programming | 16 | 05-29-2009 07:25 PM |
| Array coping into another array?or function returning array | baniakjr | C++ Programming | 6 | 11-09-2006 03:28 AM |
| [question]Analyzing data in a two-dimensional array | burbose | C Programming | 2 | 06-13-2005 07:31 AM |
| Unknown Memory Leak in Init() Function | CodeHacker | Windows Programming | 3 | 07-09-2004 09:54 AM |
| Quick question about SIGSEGV | Cikotic | C Programming | 30 | 07-01-2004 07:48 PM |