Heys guys im learning c# and socket programming so i decided to make a tcp chat, the basic idea is that A client send data to the server, then the server broadcast it for all the clients online (in this case all the clients in a dictionary). When there is 1 client connected, it works as expected, the problem is when there is more than 1 client connected. Server: class Program { static void Main(string[] args) { Dictionary list_clients = new Dictionary (); int count = 1; TcpListener ServerSocket = new TcpListener(IPAddress.Any, 5000); ServerSocket.Start(); while (true) { TcpClient client = ServerSocket.AcceptTcpClient(); list_clients.Add(count, client); Console.WriteLine("Someone connected!!"); count++; Box box = new Box(client, list_clients); Thread t = new Thread(handle_clients); t.Start(box); } } public static void handle_clients(object o) { Box box = (Box)o; Dictionary list_connections = box.list; while (true) { NetworkStream stream = box.c.GetStream(); byte[] buffer = new byte[1024]; int byte_count = stream.Read(buffer, 0, buffer.Length); byte[] formated = new Byte[byte_count]; Array.Copy(buffer, formated, byte_count); //handle the null characteres in the byte array string data = Encoding.ASCII.GetString(formated); broadcast(list_connections, data); Console.WriteLine(data); } } public static void broadcast(Dictionary conexoes, string data) { foreach(TcpClient c in conexoes.Values) { NetworkStream stream = c.GetStream(); byte[] buffer = Encoding.ASCII.GetBytes(data); stream.Write(buffer,0, buffer.Length); } } } class Box { public TcpClient c; public Dictionary list; public Box(TcpClient c, Dictionary list) { this.c = c; this.list = list; } } I created this box so i can pass 2 args for the Thread.start() Client: class Program { static void Main(string[] args) { IPAddress ip = IPAddress.Parse("127.0.0.1"); int port = 5000; TcpClient client = new TcpClient(); client.Connect(ip, port); Console.WriteLine("client connected!!"); NetworkStream ns = client.GetStream(); string s; while (true) { s = Console.ReadLine(); byte[] buffer = Encoding.ASCII.GetBytes(s); ns.Write(buffer, 0, buffer.Length); byte[] receivedBytes = new byte[1024]; int byte_count = ns.Read(receivedBytes, 0, receivedBytes.Length); byte[] formated = new byte[byte_count]; Array.Copy(receivedBytes, formated, byte_count); //handle the null characteres in the byte array string data = Encoding.ASCII.GetString(formated); Console.WriteLine(data); } ns.Close(); client.Close(); Console.WriteLine("disconnect from server!!"); Console.ReadKey(); } }