|
-
Mar 23rd, 2004, 04:38 PM
#1
Thread Starter
Lively Member
Identifying Client and sending information through the same Thread
Hello Everybody:
I have created a multithreaded client server application...The server can received 50 client connections by creating new threads..The client uses there name and phone number as parameters to connect to the server...
Now I want to send the information back to the same client
from the server. My problem is identifying the correct client and sending the information to the correct client.
I am identifying the client by using the GetHashCode method
which will be generated by the name and phone number and also through the thread which the client connects to the server. The thread generates its own hashcode . Both the hashcode of the client and the thread are displayed on the textboxes.
Now my problem is how do I code the HashCode Value of the thread and the string displayed on the textboxes to send the information back to the same client.
The code used to sent data to the client is as follows:
HashCode for THread stored in txtThreadCode.Text
HashCode for String(clientname and phonenumber) stored in txtOutput.Text
Code to send information to the client
{
Object objData = txtDataTx.Text;
byte[] byData = System.Text.Encoding.ASCII.GetBytes(objData.ToString ());
m_socWorker.Send (byData);
}
catch(SocketException se)
{
MessageBox.Show (se.Message );
}
Now my problem is how do I code the HashCode Value of the thread and the hashcode value of string displayed on the textboxes to send the information back to the same client.
Pls guide... I am stuck over here.....
Thanks,
Rahil
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|