    Private Sub broadcast(ByVal msg As String, _
    ByVal uName As String, ByVal flag As Boolean)
        ' Dim Item As Student
        Dim broadcastSocket As TcpClient
        Dim broadcastBytes As [Byte]()
        For Each Item As Student In clients
            If (Item.hostsocket.Connected = True) Then
                broadcastSocket = CType(Item.hostsocket, TcpClient)
                Dim broadcastStream As NetworkStream = _
                        broadcastSocket.GetStream()
                If flag = True Then
                    broadcastBytes = Encoding.ASCII.GetBytes(Item.cost)
                    broadcastStream.Write(broadcastBytes, 0, broadcastBytes.Length)
                    broadcastStream.Flush()
                    Console.WriteLine("i sent    " + Item.hostname)

                Else
                    broadcastBytes = Encoding.ASCII.GetBytes(msg)
                    broadcastStream.Write(broadcastBytes, 0, broadcastBytes.Length)
                    broadcastStream.Flush()


                End If

            End If
        Next
    End Sub



    Private Sub st()
        '        
        ' Dim mainthread As Threading.Thread = New Threading.Thread(AddressOf st)

        While (True)
            Dim a As New Student
            clientSocket = serverSocket.AcceptTcpClient()
            ' clientSocket = serverSocket.AcceptSocket
            msgt("Client No:" + Convert.ToString(counter) + " started!")
            msg("Client No:" + Convert.ToString(counter) + " started!")
            receiv()
            Dim client As New handleclinet '   
            client.startClient(clientSocket, Convert.ToString(counter))
            addlist(Str(counter), 0)

            a.hostname = hostname + Str(counter)
            a.hostsocket = clientSocket
            a.ID = Str(counter)
            a.ip = clientSocket.Client.RemoteEndPoint.ToString()

            a.htime = Now
            a.selected = True
            nod.Value = a
            clients.AddLast(nod.Value) '     

            clientsList.Add(a)
            bb.Add(a)



            arrycoste(counter) = 1
            counter += 1
        End While
        clientSocket.Close()
        serverSocket.Stop()
        msg("exit")

    End Sub