INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Multiple socket question  (Read 1738 times)

zigguratt

  • Regular Member
  • World Citizen
  • ***
  • Posts: 114
Multiple socket question
« 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.
Logged
The latest version of Glissando can be had here.

Nikolay

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1681
  • Former CTO, JRiver, Inc.
RE:Multiple socket question
« Reply #1 on: July 08, 2002, 11:18:44 am »

I bet our HTML server code is not working correctly.
Send us the source code and we will take a look.

Nikolay
Logged

zigguratt

  • Regular Member
  • World Citizen
  • ***
  • Posts: 114
RE:Multiple socket question
« Reply #2 on: July 08, 2002, 12:17:21 pm »

Thanks, Nikolay. I've sent the source to Matt, as I don't know your email address.
Logged
The latest version of Glissando can be had here.

zigguratt

  • Regular Member
  • World Citizen
  • ***
  • Posts: 114
RE:Multiple socket question
« Reply #3 on: July 15, 2002, 05:14:41 am »

Any ideas as to what the problem might be, Nikolay?
Logged
The latest version of Glissando can be had here.

Nikolay

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1681
  • Former CTO, JRiver, Inc.
RE:Multiple socket question
« Reply #4 on: July 16, 2002, 06:36:13 am »

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
Logged

Nikolay

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1681
  • Former CTO, JRiver, Inc.
RE:Multiple socket question
« Reply #5 on: July 16, 2002, 09:37:43 am »

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
Logged

zigguratt

  • Regular Member
  • World Citizen
  • ***
  • Posts: 114
RE:Multiple socket question
« Reply #6 on: July 16, 2002, 09:43:14 am »

Excellent, Nikolay.  Now you've done it.  I'll have to make another release with CD cover art support.

;)
Logged
The latest version of Glissando can be had here.

zigguratt

  • Regular Member
  • World Citizen
  • ***
  • Posts: 114
RE:Multiple socket question
« Reply #7 on: July 16, 2002, 09:55:59 am »

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.
Logged
The latest version of Glissando can be had here.
Pages: [1]   Go Up