Click here to Skip to main content
15,907,395 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Currently I'm building a project where I can send Massage to specific connected clients. But when ever I send data it goes to all of the connected client.I've reviewed this code but still confuse how to implement the solution :( .
Server Code
While True
           Dim incoming As TcpClient = Me.MyTcpListener.AcceptTcpClient
           Dim Str As StreamReader = New StreamReader(incoming.GetStream)
          Dim C As New Client
               C.ClientID = Me.ClientID
               C.Str = Str
               RaiseEvent _ClientConnected(C)
               AddHandler C._ClientDisconnect, AddressOf ClientDisconnected
               Me.ClientID += 1
               End While

Note : I found this code a long time ago and i only have it now. The main goal I want to achieve here is to communicate from server to specific client using client_ID.

What I have tried:

Sample of my code..:
Dim server as TCPListener
while true
end while 
Updated 21-Jan-20 19:17pm

1 solution

This seems to be how you are gathering you clients. How are you defining the client to send the message to?
Share this answer
Richard Deeming 22-Jan-20 12:56pm    
If you want to ask for more information, then click the "Have a Question or Comment?" button under the question and post a comment. Do not post your comment as a "solution".

However, given this question was posted over three years ago, and the OP hasn't posted anything since, it's unlikely that they're still interested in solving this question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900