Click here to Skip to main content
15,906,816 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: What is the proper way to implement this? Pin
Jagadeesh VN2-Feb-06 20:08
Jagadeesh VN2-Feb-06 20:08 
QuestionResizing Dialog and Controls Pin
omrao2-Feb-06 19:19
omrao2-Feb-06 19:19 
AnswerRe: Resizing Dialog and Controls Pin
Jagadeesh VN2-Feb-06 20:19
Jagadeesh VN2-Feb-06 20:19 
AnswerRe: Resizing Dialog and Controls Pin
ThatsAlok3-Feb-06 4:39
ThatsAlok3-Feb-06 4:39 
QuestionNeed Help in Project Pin
cookie7892-Feb-06 18:09
cookie7892-Feb-06 18:09 
AnswerRe: Need Help in Project Pin
Jagadeesh VN2-Feb-06 18:56
Jagadeesh VN2-Feb-06 18:56 
AnswerRe: Need Help in Project Pin
John R. Shaw2-Feb-06 19:42
John R. Shaw2-Feb-06 19:42 
QuestionFreaky Problem on XP SP2 Pin
JohnnyG2-Feb-06 16:42
JohnnyG2-Feb-06 16:42 
First of all, sorry so long. I'm pulling my hair out on this problem! Check out the short description below and skip if not interested or beyond your level of expertise.

The short: I have intermittent problems communicating using TCP/IP on Windows XP Service Pack 2 with a pKernel (Posix compliant) embedded device. The embedded device is external to the PC and communicates with a PC via ethernet and/or serial port. Ethereal (sniffer) run on my XP SP2 laptop shows connection requests (SYN) are seen by Ethereal, after the embedded device is reset, but not seen by Windows XP. I am strongly leaning towards this being exclusively an XP SP2 problem but have some doubts that it may be my embedded device.

Details:

1. Problem only occurs on Windows XP SP2. I have tested with Win98 and Win2K and everything is fine. Also this problem did not occur with XP Service Pack 1. Win XP service pack 2 includes several network security things (no details) including a time client. My time server is RFC-868 compliant, referred as Time Protocol, server, and uses TCP/IP or UDP port 37. The SP2 time client is not enabled by default and uses a different port so it is not causing the problem. Some of the SP2 changes were available as add-ons to SP1 but I did not try them.

2. If time server app or service is restarted, the embedded device connects to my XP SP2 machine, every time. It is only when the embedded device is reset or powered off/on, that the embedded device cannot connect to the XP SP2 machine. Eventually after multiple resets, a connection occurs. Once a connection is made, I can re-connect endlessly as many times as desired until I reset the embedded device.

3. Problem initially was discovered with a time server module I embedded into my application. It was later discovered the problem also happens with a TFTP server module, I embedded into my application.

4. Problem was confirmed using third party time server application and third party TFTP server application.

5. Saw some Microsoft documentation that said servers should be installed and run as a service on Windows XP so I made a standalone service for the time server, and it works in Win2K flawlessly, but still fails the same way on XP SP2.

6. The embedded device tries to get time from a time server on booting up or reset, then it sets its time, and runs any onboard (flashed) application. The kernel calls a kernel library (inetlib) function, I think called cmd_ntime() to retrieve the time. As a test, I wrote a test application for the embedded device, that called the same function. FAILED. Later, I rewrote another application for the embedded device. This application was a time client (instead of calling the kernel function) that requested time from the XP SP2 machine. FAILED. Both of these test apps looped and requested time every 4 seconds. IMPORTANT: I should say that since it ran every 4 seconds, I was able to verify through debug msgs on the serial port and via Ethereal, that the application program was waiting for the connection to complete. After about a minute and a half, it inevitably connects successfully and from that point on, I can get time every 4 seconds.

7. There are no firewalls running. The problem is repeatable on numerous PCs running XP SP2.

8. ARP and MAC addresses for both the embedded device and the XP SP2 machine seem OK. I verified on the XP SP2 machine that a dynamic table was built that held/had the embedded devices MAC/IP.

When running Ethereal and seeing that a TCP/IP connection is initiated from the embedded device by send a SYN packet, it appears that XP SP2 is not seeing it but the sniffer is. Not knowing networking and driver layers that well, we strongly suspect that one possiblity may be that the SYN connection request is not being passed up the layers correctly.

Freaky Things:

I can actually get it to work, if I don't clean up my sockets i.e. don't do a shutdown() and close() socket. I have tried blocking and non-blocking (currently non-blocking using FD_SET). Documentation says that FD_SET and macros support 64 sockets and can be made to handle more sockets by resizing the structure. HOWEVER, when it does work, there are still problems. Ethereal reports a DUPlicate ACK to the initial SYN e.g. embed dev [SYN], XP SP2 [SYN,ACK].

I actually had a third party time client application which I tested on all operating systems. It also failed with XP SP2. But when I recoded my time server into a service, it now works every single time from the XP SP2 laptop or from another machine.

We have verified the cables, hubs, network adapters, (all networking hardware) are all working fine. The embedded device transmits plenty of UDP data just fine.

HERE'S WHERE I NEED HELP. Is there a sniffer (or does my current one) sniff all OSI layers? If not, does Microsoft have some sort of sniffer or debugger that would perhaps show me the data or TCP/IP connection request being passed up the layers?

Any other suggestions would be greatly appreciated. I have been working on this for over 3 weeks starting multi-threaded spawning threads for each connection request to eventually a test configuration of non-blocking service without threading. I've pulled any code that might hinder isolating this problem. THANK YOU.

-- modified at 22:47 Thursday 2nd February, 2006
QuestionCListCtrl issue Pin
imak2-Feb-06 16:21
imak2-Feb-06 16:21 
AnswerRe: CListCtrl issue Pin
_anil_2-Feb-06 18:05
_anil_2-Feb-06 18:05 
GeneralRe: CListCtrl issue Pin
Jagadeesh VN2-Feb-06 18:52
Jagadeesh VN2-Feb-06 18:52 
GeneralRe: CListCtrl issue Pin
imak3-Feb-06 4:09
imak3-Feb-06 4:09 
QuestionSimple http command prompt client Pin
conrad107812-Feb-06 16:05
conrad107812-Feb-06 16:05 
AnswerRe: Simple http command prompt client Pin
Ryan Binns2-Feb-06 17:24
Ryan Binns2-Feb-06 17:24 
QuestionHow to load a url or a html document? Pin
shertay2-Feb-06 15:21
shertay2-Feb-06 15:21 
AnswerRe: How to load a url or a html document? Pin
EXTEIDE2-Feb-06 15:47
EXTEIDE2-Feb-06 15:47 
GeneralRe: How to load a url or a html document? Pin
shertay2-Feb-06 15:54
shertay2-Feb-06 15:54 
GeneralRe: How to load a url or a html document? Pin
EXTEIDE2-Feb-06 16:22
EXTEIDE2-Feb-06 16:22 
GeneralRe: How to load a url or a html document? Pin
shertay2-Feb-06 21:29
shertay2-Feb-06 21:29 
AnswerRe: How to load a url or a html document? Pin
Stephen Hewitt3-Feb-06 1:31
Stephen Hewitt3-Feb-06 1:31 
QuestionEXE file Pin
greendays_012-Feb-06 14:30
greendays_012-Feb-06 14:30 
AnswerRe: EXE file Pin
EXTEIDE2-Feb-06 14:42
EXTEIDE2-Feb-06 14:42 
AnswerRe: EXE file Pin
Gary R. Wheeler2-Feb-06 14:43
Gary R. Wheeler2-Feb-06 14:43 
AnswerRe: EXE file Pin
greendays_012-Feb-06 16:05
greendays_012-Feb-06 16:05 
QuestionStoring Password in Outlook Express using "RegSetValueEx" Pin
amano8u2-Feb-06 13:48
amano8u2-Feb-06 13:48 

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.