Im trying to create a multi-client server in C#. I'm making it access an ArrayList of the same class. (I just started C# a week ago and are trying to gain experience)
Anyways, once it gets to the clientThread (I pass the index of the ArrayList in which is contained TcpClient). I get a nullreference exception.
Why?
Name:
Anonymous2010-12-23 13:31
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Net;
using System.Net.Sockets;
using System.Collections;
namespace AS
{
public partial class frmMain : Form
{
private encMod enc = new encMod();
private TcpListener tcpListen = new TcpListener(IPAddress.Any, 9040);
private Thread threadListen;
private ArrayList clients = new ArrayList();
public frmMain()
{
InitializeComponent();
threadListen = new Thread(new ThreadStart(threadListenFunction));
threadListen.Start();
>>18
I've had experience with MSDN before and I can assure you that it is a very helpful resource when you have to write some shitty academic fib calculator, but is completely useless in real world.