Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 18th, 2005, 10:06 PM   #1
anarki
Newbie
 
Join Date: Oct 2005
Posts: 5
Rep Power: 0 anarki is on a distinguished road
multi thread

hi all, i am making an multithread client that connects to differents servers using differents threads.
in the main window the user select the numbers of connections that the program will start.
To make make this i created the threads inside a loop like this:

GetDlgItemText(IDC_SIMULTANEOS, n);
int a = _ttoi(n.GetBuffer(n.GetLength()));

for(LONG i=0; i<a; i++) {

m_serverName.GetText(i, str);

...
....

pThread->ResumeThread();
}

The program creates succefully the number of connections to the server specified in a, for example it creates 2 threads.

Now, i need to do read operations on the different threads created.

I can see theat write and read operations works only on the last process(thread, connection) created.(sniffing packets i

realize that the data pushed are in the higher port number of the two established connections on my local machine to the

second server on the list).

How can i identify the different threads created in the loop and make write and read operations on them??
Thanx in advance.
anarki is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:19 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC