Click here to Skip to main content
15,923,557 members
Home / Discussions / C#
   

C#

 
GeneralRe: create a changing in pin code number of atm application in c# Pin
N a v a n e e t h17-Sep-08 21:53
N a v a n e e t h17-Sep-08 21:53 
JokeRe: create a changing in pin code number of atm application in c# Pin
Giorgi Dalakishvili17-Sep-08 21:57
mentorGiorgi Dalakishvili17-Sep-08 21:57 
JokeRe: create a changing in pin code number of atm application in c# Pin
Mycroft Holmes17-Sep-08 21:55
professionalMycroft Holmes17-Sep-08 21:55 
JokeRe: create a changing in pin code number of atm application in c# Pin
Giorgi Dalakishvili17-Sep-08 22:00
mentorGiorgi Dalakishvili17-Sep-08 22:00 
GeneralRe: create a changing in pin code number of atm application in c# Pin
Dewald18-Sep-08 1:04
Dewald18-Sep-08 1:04 
GeneralRe: create a changing in pin code number of atm application in c# Pin
Giorgi Dalakishvili18-Sep-08 1:12
mentorGiorgi Dalakishvili18-Sep-08 1:12 
GeneralRe: create a changing in pin code number of atm application in c# Pin
Member 1372570716-Mar-18 7:31
Member 1372570716-Mar-18 7:31 
GeneralRe: create a changing in pin code number of atm application in c# Pin
Dan Neely18-Sep-08 2:28
Dan Neely18-Sep-08 2:28 
AnswerRe: create a changing in pin code number of atm application in c# Pin
Mycroft Holmes17-Sep-08 21:57
professionalMycroft Holmes17-Sep-08 21:57 
GeneralRe: create a changing in pin code number of atm application in c# Pin
mdiqbal8717-Sep-08 22:06
mdiqbal8717-Sep-08 22:06 
GeneralRe: create a changing in pin code number of atm application in c# Pin
Mycroft Holmes17-Sep-08 22:15
professionalMycroft Holmes17-Sep-08 22:15 
GeneralRe: create a changing in pin code number of atm application in c# Pin
PaulPrice18-Sep-08 1:42
PaulPrice18-Sep-08 1:42 
GeneralRe: create a changing in pin code number of atm application in c# Pin
Mycroft Holmes18-Sep-08 2:32
professionalMycroft Holmes18-Sep-08 2:32 
GeneralRe: create a changing in pin code number of atm application in c# Pin
Harvey Saayman18-Sep-08 2:43
Harvey Saayman18-Sep-08 2:43 
GeneralRe: create a changing in pin code number of atm application in c# Pin
Mycroft Holmes18-Sep-08 2:51
professionalMycroft Holmes18-Sep-08 2:51 
GeneralRe: create a changing in pin code number of atm application in c# Pin
Harvey Saayman18-Sep-08 2:53
Harvey Saayman18-Sep-08 2:53 
AnswerGet out of the programming industry!!! Pin
Harvey Saayman18-Sep-08 2:41
Harvey Saayman18-Sep-08 2:41 
AnswerCreate one yourself. This is very easy. [modified] Pin
John M. Drescher18-Sep-08 2:52
John M. Drescher18-Sep-08 2:52 
Questionquery Pin
lankaudaranga17-Sep-08 20:44
lankaudaranga17-Sep-08 20:44 
AnswerRe: query Pin
Blue_Boy17-Sep-08 21:58
Blue_Boy17-Sep-08 21:58 
AnswerRe: query Pin
Mycroft Holmes17-Sep-08 22:03
professionalMycroft Holmes17-Sep-08 22:03 
AnswerRe: query Pin
Harvey Saayman18-Sep-08 2:47
Harvey Saayman18-Sep-08 2:47 
QuestionHot Mail Contacts Pin
nhss17-Sep-08 20:32
nhss17-Sep-08 20:32 
AnswerRe: Hot Mail Contacts Pin
Mycroft Holmes17-Sep-08 22:20
professionalMycroft Holmes17-Sep-08 22:20 
QuestionTcpClient connects very slow [modified] Pin
Mark Snow17-Sep-08 20:20
Mark Snow17-Sep-08 20:20 
hi i am trying to write a method for checking which hosts are alive by connecting to the known application port. but i ran into a very weird thing, connecting to 200 hosts takes me about 10 minutes in my application and not more then 45 sec on a test application with same piece of code.
this are windows applications, the code runs in a separate thread and it's logic is:

int threads = 200;
List<system.net.sockets.tcpclient> clientList = new List<system.net.sockets.tcpclient>(threads);
List<iasyncresult> resultList = new List<iasyncresult>();

for (int i = 0; i < threads; i++)
{
System.Net.Sockets.TcpClient client = new System.Net.Sockets.TcpClient();
IAsyncResult result = null;
try
{
	result = client.BeginConnect(testedHost, testedPort, null, null);
}
catch
{
}
clientList.Add(client);
resultList.Add(result);
}

for (int i = 0; i < threads; i++)
{
try
{
	clientList[i].EndConnect(resultList[i]);
	clientList[i].Close();
}
catch
{
	//processint the result and determining if tested host is alive or not
}

}
</iasyncresult></iasyncresult></system.net.sockets.tcpclient></system.net.sockets.tcpclient>


did anyone have problems with BeginConnect/EndConnect, or has any clue why the same block of code could work much slower? in both applications only the main thread and additional thread(where this code runs) are present, no more threads to take the cpu resources.

modified on Thursday, September 18, 2008 2:28 AM

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.