void CTestsocketDlg::OnButton1()
{
// TODO: Add your control notification handler code here
for (int i = 0; i < 100; ++i)
{
::AfxBeginThread(TestSocket, (LPVOID)0);
}
}
output:
~~~~~~~~sock[1193]
~~~~~~~~sock[1195]
~~~~~~~~sock[1197]
~~~~~~~~sock[1199]
~~~~~~~~closesocket[1199]
the socket handle 1193 1195 1197 are not closed.
--
Message posted via http://www.pocketpcjunkies.com
Hi. Cause some threads wait for connection. May be server can't accept
100 connections.
Ation wrote:
>On 23 июн, 05:38, "fantasy1215 via PocketPCJunkies.com" <u50650@uwe>
>wrote:
>> In a dialog, click a button to create 100 threads to connect to a server,
>> codes are below, but in some thread it don't closesocket, can somebody
>[quoted text clipped - 48 lines]
>> --
>> Message posted viahttp://www.pocketpcjunkies.com
>
>Hi. Cause some threads wait for connection. May be server can't accept
>100 connections.
--
Paul T.
"fantasy1215 via PocketPCJunkies.com" <u50650@uwe> wrote in message
news:9804c0ec4c7ce@uwe...
> but what happen to the unclosed socket handle? Do I waste them? If connect
> block, and closesocket hasn't run, then the thread is blocked in
> connect(),
> not exit right?
>
> Ation wrote:
>>On 23 ???, 05:38, "fantasy1215 via PocketPCJunkies.com" <u50650@uwe>