views:

122

answers:

3

I am developing a program which sends images from one computer to another (similar to remote assistance without mouse/keyboard input). The two computers I use to test this are one Windows XP machine and one Windows Vista. I have the stationary XP machine directly connected to a router, and a laptop which is connected through wireless.

The transmission from XP to Vista works great, I am able to get a constant flow of images that are displayed on Vista. However, when I flip it and send images from Vista to XP it does not work. I also tried a local "copy", that is, without the network get a flow of images and this works on Vista as well as XP. It is the exact same program on both machines.

I don't think it matters but I am using GDI+ for the images. So I send a .jpg through a stream on the network and rebuild it on the other side.

My Network Message class is called NetMsg. it consists of a char* type and a char* data. the types determine how I interpret the data, no issues here.
Let's call the computers #1 and #2.
When connection is created and I marked the area on #1 that I want to send:
001>#1 sends type RESIZE // to get the window on #2 the same size as the area I have marked on #1
002>#1 sends type PICTURE_DATA // this is the actual imagedata
003>#2 after received the two above messages, sends type REQUEST_MORE // #2 wants more imagedata
004>#go to step 1

I haven't even bothered to debug it when sending image data from XP to Vista, since it works great, exactly like I want it. However when Vista sends to XP I have noticed the following:

  • Data received can actually be two NetMsgs. I have support for this by splitting the data into several NetMsgs
  • Data received can be incomplete, that is I have to wait for more data. I have support for this by marking a NetMsg as incomplete and on the next datatransmission complete it. (as well as a combination of the first step)

This almost did the trick because I got some images transferred correctly, however then it suddenly stopped. I have not debugged this thoroughly so I do not know why the data suddently stopped.. However:

What I do not understand is that this works great when sending from XP to Vista but not the other way around. What am I missing?

Do let me know if you need extracts of code, however, it is pretty huge... roughly 500 rows.. Otherwise I am looking for known issues when sending data from Vista to XP.

Any help and/or feedback appreciated!

A: 

It is difficult to really say anything with any certainty. However, I would strongly suggest that you write a test suite for your program and implement a test case which catches this particular problem. This will make it easier for you to reproduce the failure, and it is often very instructive to try to produce a minimal test case which can demonstrate the problem. Also, when you have a (fully automatic) test case, it is also easier to ask someone else for help.

JesperE
A: 

What you really need to do is describe the problem in more detail. There could be 100's of reasons why "it isn't working".

Are you getting any data through?

Try sending just a few bytes, do they get through?

If nothing is getting through, try using Wireshark, is Vista sending the data out?

Is XP receiving it?

No magic here, you will have to check the data path from start to finish.

A: 

It was actually blocking on both computers and both were waiting for the other to respond.

Default