Official eMule-Board: Nt Service Feature, How To Use - Official eMule-Board

Jump to content


Page 1 of 1

Nt Service Feature, How To Use

#1 User is offline   i92guboj 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 08-May 12

Posted 15 May 2012 - 01:02 PM

Hello.

I am a newcomer. I hope this section is ok.

I am using the morphxt mod, for no particular reason, other than the fact that this is one of the mods that can run as an nt service. I left windows like a decade ago, and, since then, I haven't done much work with it. I am a bit disoriented about how this works.

In any *nix-like OS, I'd just fire up the server daemon (call it amule, mldonkey, or whatever else), and then use web or gui (or ncurses) clients to connect to the local server, while it does all the job. In windows 7, I installed the emule mod, ran it as admin (otherwise it would not let me install the service), installed the nt service, and everything seemed to go alright.

I rebooted, and then logged in on any random user. I checked the tasks administrator (clicked on the button to see the processes from all the users), and emule was there, only taking around 13mb or ram (nice, compared to +30 that the gui takes from second zero). So, the service is running, and I guess it's doing its job (or maybe not, I'll check that later, but the sure thing is it is running, and the owner is SYSTEM). Any help in how to monitor it's activity is welcome, by the way.

But, that's not my main concern. It is the client part which I am more dubious about. When I fire up the emule lnk, it starts the gui as always (even though I selected an option that's supposed to start the web client in my browser of choice). And it seems to start looking for servers just like it always did. So, is there a way to configure emule so it connects to the local server instead of looking for remote ones? Is there a better approach? I know there's a web frontend, but I am not sure how to use it. For example, in linux you'd direct the browser to localhost:4080 for mldonkey. Would this approach give me support for the ed2k:// protocol as well? Maybe vie a firefox plugin or something?

The whole point of running a service, besides not having to log in, is to handle the resources in a smart manner, without having a dozen local copies of emule in your ram fighting for your bandwidth, isn't it?

Forgive me if I am missing something simple, but I've been looking into this for days (since I registered in the forum) and obviously I have been looking into the wrong place because I still don't know how this works.

If there are some docs about this (up-to-date ones) please, kindly direct me to them and I'll do the research on my own.
0

#2 User is offline   Stulle 

  • [Enter Mod] Dev
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5,728
  • Joined: 07-April 04

Posted 15 May 2012 - 06:01 PM

Hey, sounds like you got a good grasp about the whole service thing. The problem is that we cannot simply start up the GUI since the client is not coded in a way it allows core and front end to run independently. Hence will you have to either stop the service and start the client with GUI or use the web service. This comes with the downside of not being able to handle ed2k links like you could when running the client normally.

I never tested the whole service business with a non-admin client so I cannot be certain how it actually behaves. However, it appears plausible that starting the client again with a non-admin user will start another instance of eMule.exe because the service cannot be stopped.

My suggestion is you start using the web service to interact with the client. It does not offer full functionality, although I added some more in StulleMule (and possibly MorphXT, too, don't recall in detail just now). You get to choose between three possible interfaces. The very basic "Light" interface, the normal interface and the multi-user interface which adds some more functionality.

If I missed anything in your last post please just ask further questions. Hopefully this still helped you.
I am an emule-web.de member and fan! Hate me or people will get suspicious about you! Ever wondered if it's all worth the trouble?

Posted Image

No, there will not be a new version of my mods. No, I do not want your PM. No, I am certain, use the board and quit sending PMs. No, I am not kidding, there will not be a new version of my mods just because of YOU asking for it!
0

#3 User is offline   omeringen 

  • löl
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 954
  • Joined: 01-January 06

Posted 15 May 2012 - 09:26 PM

View Posti92guboj, on 15 May 2012 - 04:02 PM, said:

(. . .) you'd direct the browser to localhost:4080 for mldonkey. Would this approach give me support for the ed2k:// protocol as well? Maybe vie a firefox plugin or something?

The whole point of running a service, besides not having to log in, is to handle the resources in a smart manner, without having a dozen local copies of emule in your ram fighting for your bandwidth, isn't it?
(. . .)

You can log-in to webinterface :
localhost:4711
127.0.0.1:4711
LANip:4711
0

#4 User is offline   adames 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 22-May 12

Posted 22 May 2012 - 09:14 AM

Sono d'accordo con te. Posted Image
0

#5 User is offline   i92guboj 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 08-May 12

Posted 01 June 2012 - 04:58 PM

Hello, and please, forgive me for taking so long to come back.

I've been quite busy these lasts weeks and I've had no time to devote to this issue.

I understand that emule is not created from the ground with a server-client model in mind, and mods can't easily fix that without rewriting a big part of the core. That'd be a non-trivial thing to do, I guess (i've certainly not looked into the emule sources at all). In any case, and coming from linux, this model looks awkward and difficult to handle, to me, though I understand it's been designed with single user in mind...

I have no problem copying and pasting links in a web frontend, and that's what I've been doing in mldonkey for a long time anyway. But the key word here is "I". I've hit this situation because the "I" in this case is not really important, and because this is a multiuser environment, which make these suggestions hard to implement in a convenient way. People are used to just click ed2k links, and most users do not know what an http URL is, at all, let alone a self-made protocol like ed2k. The times when we used http, ftp, gopher and the like are gone, new people don't worry about this, they just want to click whatever makes the mouse pointer become a pointing hand, and they hope that when doing that something will happen.

They don't even understand that the url bar is not a part of the web, and that there's a difference between it and the google input field.

The solution I've found for now involves powershell, and it's a wrapper I hacked for emule.exe which will just look for running instances, and kill them before launching a new one with admin permissions, so they don't collide and at a given moment there's only one instance running. This has the downside of stopping the downloads each time a new user launches emule, but has the upside that at least, we can operate without having the whole ram filled with copies of emule.exe, on a machine that's not top-notch.

Thank you everyone for taking the time to respond. And please, again, forgive me for taking so long to answer. I appreciate the answers :)

ps: security is not a concern in this lan, that's why I could easily implement this with powershell. I know this solution is deficient at most, which is why I am not posting the script here unless someone requests it.

This post has been edited by i92guboj: 01 June 2012 - 05:00 PM

0

#6 User is offline   Stulle 

  • [Enter Mod] Dev
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5,728
  • Joined: 07-April 04

Posted 01 June 2012 - 08:00 PM

On that note, have you tried parsing the ed2k as a parameter for the emule.exe? I only gave it a very swift look but apparently there is the possibility to add links via command line commands. However, there does not seem to be any documentation on e-p.net.

So you might want to check out emule.cpp and in particular "bool CemuleApp::ProcessCommandline()"
//this codepart is to determine special cases when we do add a link to our eMule
	//because in this case it would be nonsense to start another instance!
	if(bIgnoreRunningInstances)
	{       
		if (cmdInfo.m_nShellCommand == CCommandLineInfo::FileOpen
			&& (cmdInfo.m_strFileName.Find(_T("://")) > 0
			|| CCollection::HasCollectionExtention(cmdInfo.m_strFileName)) )
			bIgnoreRunningInstances = false;
	}
	if (!bIgnoreRunningInstances){
		bAlreadyRunning = (::GetLastError() == ERROR_ALREADY_EXISTS ||::GetLastError() == ERROR_ACCESS_DENIED);
    	if (bAlreadyRunning) EnumWindows(SearchEmuleWindow, (LPARAM)&maininst);
	}

    if (cmdInfo.m_nShellCommand == CCommandLineInfo::FileOpen) {
		CString* command = new CString(cmdInfo.m_strFileName);
		if (command->Find(_T("://"))>0) {
			sendstruct.cbData = (command->GetLength() + 1)*sizeof(TCHAR);
			sendstruct.dwData = OP_ED2KLINK;
			sendstruct.lpData = const_cast<LPTSTR>((LPCTSTR)*command);
    		if (maininst){
      			SendMessage(maininst, WM_COPYDATA, (WPARAM)0, (LPARAM)(PCOPYDATASTRUCT)&sendstruct);
				delete command;
      			return true;
			}

There is more but this seems to be the most important bit, I think...
I am an emule-web.de member and fan! Hate me or people will get suspicious about you! Ever wondered if it's all worth the trouble?

Posted Image

No, there will not be a new version of my mods. No, I do not want your PM. No, I am certain, use the board and quit sending PMs. No, I am not kidding, there will not be a new version of my mods just because of YOU asking for it!
1

  • Member Options

Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users