INTERACT FORUM
Windows => Plug-in Development => Topic started by: zigguratt on July 05, 2002, 07:01:33 am
-
I'm trying to modify Web Remote so it can service more than one client simultaneously. With web pages this isn't normally a problem as the connection is momentary. But with XML socket connections the socket is held open indefinitely.
It seems that if there's an XML socket open and a second client requests a web page (opening and closing another socket), the XML socket is closed as well - or at least mutilated somehow - cutting off the XML client.
Is this normal behaviour? I would think that one socket's closing shouldn't affect others.
-
I bet our HTML server code is not working correctly.
Send us the source code and we will take a look.
Nikolay
-
Thanks, Nikolay. I've sent the source to Matt, as I don't know your email address.
-
Any ideas as to what the problem might be, Nikolay?
-
zigguratt,
I got the source, but we are very busy with MJ 8.0 fixes. I think I'll get to it today or tomorrow.
Nikolay
-
Here is the fix:
replace this code in HTTPMJServer.cpp
ACCEPT_STRUCT accept_Info;
accept_Info.pParent = pParentClass;
accept_Info.iAcceptSocket = isocket;
HANDLE hAccept = (HANDLE)_beginthread(AcceptThread, 0, &accept_Info);
with following:
ACCEPT_STRUCT * pAccept_Info = new ACCEPT_STRUCT;
pAccept_Info->pParent = pParentClass;
pAccept_Info->iAcceptSocket = isocket;
beginthread(AcceptThread, 0, pAccept_Info);
add
delete accept_Info;
after this code:
Close:
closesocket(accept_Info->iAcceptSocket);
g_ServerInfo.iNumConnected--;
Nikolay
-
Excellent, Nikolay. Now you've done it. I'll have to make another release with CD cover art support.
;)
-
Yep, that fix worked. Now any number of clients can connect at the same time. This will make retrieval of cover art possible now.
Woohoo! Thanks, Nikolay.