From: Hector Santos on
Joseph M. Newcomer wrote:

>> if (PeerInfo != "") return PeerInfo; // HLS FIX
> ****
> Try this:
> if(!PerrInfo.IsEmpty())
> return PerrInfo;
> Note that it should be _T("")
> ****

Too many letters to type to reach the same result. :)

Plus, I like how it reads so that is what I use normally use in all
languages I work with that offer Object based string with inherent
operators.

--
HLS
From: Hector Santos on
Joseph M. Newcomer wrote:

> I had not spotted any memory leaks, so I'd like to know, so I can fix them.
> joe

Just all I did was compile the code and before and after the minor
changes for the PeerInfo stuff and adding a simple echo logic, I used
a simple TTY to connect and type away.

1) After the first 3-4 letters, there was an exception. I believe your
explanation that it assumes a 4 byte packet or whatever explains that.

2) And when exiting the application, the IDE dumped a few leaks.

Let me try it again....

Ok, started the AsyncServer under the IDE, port 13000.

Open a Penalty Box and typed

Telnet LocalHost 13000

typed

HELLO<enter>
ctrl ]
QUIT

The socket closed and clicked EXIT, the IDE output shows:

Dumping objects ->
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\sockcore.cpp(933) : {154}
normal block at 0x00369D90, 28 bytes long.
Data: < s ` > CD CD CD CD 73 03 00 00 60 0F 00 00 01 00
00 00
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\sockcore.cpp(933) : {150}
normal block at 0x00369658, 28 bytes long.
Data: < s ` > CD CD CD CD 73 03 00 00 60 0F 00 00 01 00
00 00
Object dump complete.


Its odd that it shows that path. I don't see RTL LIB that your binding.

I just also did another thing.

I compiled the AsyncClient and ran it to connect to the AsyncClient.

I connected and entered "hello" in the Send field, clicked Send and
POOF! the AsyncServer faulted. Here is the call stack:

AsyncServer.exe!CAsyncServerDlg::OnNetworkData(unsigned int
wParam=3579544, long lParam=1700) Line 421 + 0xd bytes C++
mfc80d.dll!CWnd::OnWndMsg(unsigned int message=32970, unsigned int
wParam=3579544, long lParam=1700, long * pResult=0x0012f850) Line
2004 + 0x11 bytes C++

mfc80d.dll!CWnd::WindowProc(unsigned int message=32970, unsigned int
wParam=3579544, long lParam=1700) Line 1741 + 0x20 bytes C++

mfc80d.dll!AfxCallWndProc(CWnd * pWnd=0x0012fb5c, HWND__ *
hWnd=0x0019056c, unsigned int nMsg=32970, unsigned int wParam=3579544,
long lParam=1700) Line 240 + 0x1c bytes C++

mfc80d.dll!AfxWndProc(HWND__ * hWnd=0x0019056c, unsigned int
nMsg=32970, unsigned int wParam=3579544, long lParam=1700) Line 389 C++

mfc80d.dll!AfxWndProcBase(HWND__ * hWnd=0x0019056c, unsigned int
nMsg=32970, unsigned int wParam=3579544, long lParam=1700) Line 411 +
0x15 bytes C++

user32.dll!7e418734()
user32.dll!7e418816()
user32.dll!7e4189cd()
user32.dll!7e4196c7()
mfc80d.dll!AfxInternalPumpMessage() Line 183 C++
mfc80d.dll!CWinThread::PumpMessage() Line 896 C++
mfc80d.dll!AfxPumpMessage() Line 190 + 0xd bytes C++

mfc80d.dll!CWnd::RunModalLoop(unsigned long dwFlags=4) Line 4322 +
0x5 bytes C++

mfc80d.dll!CDialog::DoModal() Line 587 + 0xc bytes C++
AsyncServer.exe!CAsyncServerApp::InitInstance() Line 67 + 0xb
bytes C++

mfc80d.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__
* hPrevInstance=0x00000000, char * lpCmdLine=0x00151f3b, int
nCmdShow=1) Line 37 + 0xd bytes C++

AsyncServer.exe!WinMain(HINSTANCE__ * hInstance=0x00400000,
HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f3b,
int nCmdShow=1) Line 33 C++

AsyncServer.exe!__tmainCRTStartup() Line 589 + 0x35 bytes C
AsyncServer.exe!WinMainCRTStartup() Line 414 C
kernel32.dll!7c817077()

--
HLS