Socket [] sockets=new Socket[10]; for (int socketnumber=0;socketnumber<10;socketnumber++) { for( int i=startport;i<endport;i++)> { IPEndpoint remote_endpoint; // Some Server remote_endpoint.Port = i; //Only Port is different on server sockets[socketnumber].Connect(remote_endpoint ); Thread.Sleep(10); sockets[socketnumber].Send(packet1); Thread.Sleep(10) sockets[socketnumber].Receive(packet2);//I get a crash here up till //socket number ==9. Only socketnumber=9 works i.e the last socket. } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)