WSP 3.0 On WinXP

Jul 10, 2013 at 9:53 AM
Edited Jul 10, 2013 at 12:12 PM
Hi, Keithh,

We are trying to test WSP 3.0.

We run hub router in window 20008 server, and having node router on winxp and win 20008 server to connect to it.

We observed node router on winxp has the problem to talk with hub router:

With some debugging, we noticed:

For hub router and node router, the receiveEventArg_Completed was fired, but no bytes got received from other side, failed to pass:

if (receiveEventArg.BytesTransferred <= 0 || receiveEventArg.SocketError != SocketError.Success)

We noticed the socket was in operationaborted status sometime.

We can run node router on window server 2008, but sometime we failed to run it on winxp.

I think 3.0 should support WINXP SP3. We have successfully deployed and run WSP2.1 on user winxp boxes, does any changes in 3.0 cause this issue?

Thanks
Coordinator
Jul 10, 2013 at 1:33 PM
I haven't run XP for a few years. Of course the code has changed from Wsp 2.1 to Wsp 3.0 but the biggest change would be moving to .Net 4.0. If there are issues, I wouldn't be surprised if it's because of .Net. I'm probably not of much help for XP issues.

Keith
Jul 15, 2013 at 7:56 AM
Edited Jul 15, 2013 at 7:59 AM
Keithh,

Thanks for the quick answer.

We noticed receiveEventArg_Completed was always trigger after the thread ended on WINXP. The router worked well after we added state.receiveDone.WaitOne() at the end of the ConnectionInStart method. Seems receiveDone varaible is unused, the wait** method was never called, Do you forgot to put it there or it is just unneccessary?

It's interesting question to me, I cannot understand why it works well on Window Server 2008, but has the issue with WINXP. Putting receiveDone there can keep the thread alive, which keeping the local variable SocketAsyncEventArgs object alive. does it because when SocketAsyncEventArgs object was reclaimed by GC, the Completed event will be fired implicitly and there are different type GCs running on Window Server 2008/WINXP? How do you think about that?
public void ConnectionInStart()
            {
                SocketAsyncEventArgs receiveEventArg;
                ReceiveState state = new ReceiveState();

                state.Reset();

                state.socket = this.socket;
                state.socketInfo = this.clientSocketInfo;
                state.socketQueue = this.socketQueue;

                receiveEventArg = new SocketAsyncEventArgs();
                receiveEventArg.Completed += new EventHandler<SocketAsyncEventArgs>(receiveEventArg_Completed);
                receiveEventArg.UserToken = state;
                receiveEventArg.SetBuffer(state.buffer, 0, state.buffer.Length);

                if (state.socket.ReceiveAsync(receiveEventArg) == false)
                {
                    ProcessReceive(receiveEventArg);
                }
                
                //Missed line?
                state.receiveDone.WaitOne();             
                return;
            }
Thanks again.
Coordinator
Jul 17, 2013 at 5:47 AM
I suspect receiveDone is obsolete code that I never removed. I wouldn't be surprised if the differences between the server GC on 2008 and the client GC on XP are the issue. But since I haven't touched XP for years, I will probably never know for sure. The real question is, why are you still on XP?
Jul 17, 2013 at 9:18 AM
Keithh,

Can you help confirm whether the receiveDone is obsolete? is there anything bad introduced if we have that line in our codes?

It's hard for me to answer your question, i think the boss want to save the money :-), the important things is we still have some users run the business on xp

Thanks.
Coordinator
Jul 17, 2013 at 1:09 PM
Having the line of code seems fine. I don't use receiveDone any longer but if you need it then that is OK. It would appear to keep an extra thread alive when it's not necessary for server 2008. You'll just have to remember to add that line of code whenever I update the code since I'm not going to add it.