stcn52 / flowlib

Automatically exported from code.google.com/p/flowlib
0 stars 0 forks source link

Can't download filelists from hub IP 127.0.0.1 #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1) change ActiveDownloadFilelistFromUser.cs like this:

                case Actions.UserOnline:
                    UserInfo usrInfo = e.Data as UserInfo;
                    if (usrInfo == null) return;
                    users.Enqueue(usrInfo.ID);
                    bool hasMe = (hub.GetUserById(hub.Me.ID) != null);
                    if (hasMe && users.Count > 0)
                        Console.WriteLine(users.Count + " users");
                    while (hasMe && users.Count > 0)
                    {
                        string usrId = users.Dequeue();
                        User usr = null;
                        if ((usr = hub.GetUserById(usrId)) != null)
                        {
                            ContentInfo info = new ContentInfo
(ContentInfo.FILELIST, BaseFilelist.XMLBZ);
                            info.Set(ContentInfo.STORAGEPATH, currentDir + 
@"Filelists\" + usr.ID + ".dcxml.bz2");
                            Console.WriteLine(usr.ID);
                            DownloadItem dwnItem = new DownloadItem(info);
                            downloadManager.AddDownload(dwnItem, new Source
(hub.RemoteAddress.ToString(), usr.ID));
                            UpdateBase(this, new FmdcEventArgs
(Actions.StartTransfer, usr)); // Start transfer to user
                            for (int i = 0; i < 300; i++)
                                if (downloadManager.ContainsDownload
(dwnItem))
                                    System.Threading.Thread.Sleep(100);
                            downloadManager.RemoveDownload(dwnItem);  // 
to avoid other bug during saving many filelists at one time
                        }
                    }
                    break;

2) also add next line in the beginning of this class
        public Queue<string> users = new Queue<string>();

3) use address "127.0.0.1" for hub IP

- this code successfully connects to my hub, shows all nicks on the hub,
but downloads filelist only from one IP (localhost)
and can't download filelists for others.

Why? - I don't know.
What happens? - simply exiting from the cycle by timeout (30 seconds) - 
for other users (without any program exeptions).
What is the expected output? - downloading all filelists, from all users.
What do you see instead? - downloading filelist only from one user - with 
the same IP as the hub.
What version of the product are you using? - FlowLib 20080628.
On what operating system? - Windows XP Eng + Russian MUI + Russian system 
locale.
Call Stack? - there are no any exceptions.
Other info - my DC++ hub PtokaX 0.3.6.0,
VS 2005, and this code are running on the same computer.

Original issue reported on code.google.com by arctic....@gmail.com on 14 Aug 2008 at 2:13

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
What happens if you add this:
            hubConnection.Me.Set(UserInfo.IP, "0.0.0.0");
after:
            hubConnection.Me.Mode = FlowLib.Enums.ConnectionTypes.Direct;

Where you replace "0.0.0.0" with your public IP (http://whatismyip.org/)

Original comment by blomman84 on 14 Aug 2008 at 8:48

GoogleCodeExporter commented 9 years ago
>What happens if you add this:
>            hubConnection.Me.Set(UserInfo.IP, "0.0.0.0");
>after:
>            hubConnection.Me.Mode = FlowLib.Enums.ConnectionTypes.Direct;
>Where you replace "0.0.0.0" with your public IP (http://whatismyip.org/)

OK, it works as expected - "downloading all filelists, from all users".
But this solution will not work for unknown (changing) public IP.

Original comment by arctic....@gmail.com on 18 Aug 2008 at 4:10

GoogleCodeExporter commented 9 years ago
Good, then i will close this issue.
If dynamic ip is a big issue for you i would recommend one of the following:

   * You could retrieve your ip on application start (One way to get it is to get
content from http://whatismyip.org/)
   * Add a Feature request on: http://code.google.com/p/flowlib/wiki/FeatureRequests

Original comment by blomman84 on 18 Aug 2008 at 6:50

GoogleCodeExporter commented 9 years ago

Original comment by blomman84 on 18 Aug 2008 at 6:51