Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > Components & Controls > Net / Sockets

Net / Sockets Components for network and related use

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-04-2009, 12:33 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jul 2009
Posts: 1
Reputation: 0
casirus is on a distinguished programming path ahead
Unhappy TCP Server/Client "Individual Send To Conected client"

Hello Well My Issue Is this i have spent the past 2 weeks working On A Chat Program for a client of mine and i seem to of hit a dead end.

I have got the server app an the Client app Both Working to what i can see But My issue is i was only asked 4 days ago if i could add a Private msg and Whisper Feature as well as admin controls I have Done what i could to it then realised i have no idea how to only send the data to the selected client.

So heres my Question How Would I send Data Not To all conected Clients But Only to the selected Client that the user has selected For the User name ListBox???


here is the code below that adds the user to the servers memory

Code:
Private Sub ConnectUser(ByVal userName As String, ByVal sender As UserConnection)
        If clients.Contains(userName) Then
            ReplyToSender("REFUSE", sender)
        Else
            sender.Name = userName
            UpdateStatus(userName & " has joined the chat.")
            clients.Add(userName, sender)
 
            ' Send a JOIN to sender, and notify all other clients that sender joined
            ReplyToSender("JOIN", sender)
            SendToClients("CHAT|" & sender.Name & " has joined the chat.", sender)
        End If
    End Sub
And also as far as im aware it stores the client at a hash table I say im aware that's because it was my partner who done this part of code but he is in hospital

Code:
Private clients As New Hashtable()
Im not sure how to select the user from the hash table and then send the needed string to the selected user once the admin on the server clicks the corresponding on the context menu

Any Help Would Be Greatly Appreciated

Thanks In Advance

D.L.H.

Any Help Would Be Greatly Appreciated
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
client, server, tcp


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 10:28 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.