DCPlusPlus.Client Class Reference

the main class of our library were all spider threads lead together handles most of the tidious work a client has to do More...

Collaboration diagram for DCPlusPlus.Client:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Client ()
 Client Constructor this will setup some event handlers and default options.
void ConnectHub (Hub me)
 Connect to a hub this will initialize a hub with some client values like our nickname etc add some event handlers and start connecting to it.
void DisconnectHub (Hub me)
 Disconnect a hub this will also remove all event handlers from that hub (TODO this behaviour will cause problems in multi client scenarios,find a workaround).
void FindAlternateSources (Queue.QueueEntry me)
 Find more sources for a queue entry this will send a tth search to all connected hubs.
Hub FindUserHub (string username)
 Find the hub to which a user is connected to TODO not implemented.
string GetClientDirectory ()
 Get the directory the client was installed in.
void GetFileList (Hub hub, string username)
 Start getting a file list from a user.
void GetTTHL (Queue.QueueEntry me)
 TODO Work in progress.
void Search (string search_tth, bool is_tth)
 Search for a tth on all hubs this will send a search request to every connected hub.
void Search (Hub.SearchParameters sp)
 Search for something on all hubs this will send a search request to every connected hub.
void Search (string search_string, bool size_restricted, bool is_max_size, int size, Hub.SearchFileType file_type)
 Search for something on all hubs this will send a search request to every connected hub.
void Search (string search_string)
 Search for something on all hubs this will send a search request to every connected hub.
void StartDownload (Queue.QueueEntry me)
 Start downloading a queue entry this will send connection requests to every source of the entry.
void StartDownload (Queue.QueueEntry.Source source)
 Start downloading from specific queue entry source this will send a passive or active connection request to a specific user.
void StartDownload (SearchResults.SearchResult result)
 Start downloading a search result ,also adds a queue entry.
void StopDownload (Queue.QueueEntry me)
 Stop downloading a queue entry this will look for a peer using this entry and disconnect it (TODO add a PauseDownload, because this doesnt stop new connections from downloading data for this entry again).
void UpdateConnectionSettings ()
 Update local port bindings needs to be called after the user changed the ports or his external ip.

Public Attributes

event Hub.ConnectedEventHandler HubConnected
 Event handler that gets called when our client connected to a hub.
event Hub.DisconnectedEventHandler HubDisconnected
 Event handler that gets called when our client was disconnected from a hub.
event Hub.LoggedInEventHandler HubLoggedIn
 Event handler that gets called when our client logged into a hub.
event Hub.MainChatLineReceivedEventHandler HubMainChatReceived
 Event handler that gets called when our client received some chat from a hub (main chat).
event Hub.MoveForcedEventHandler HubMoveForced
 Event handler that gets called when our client received a wish of a hub to move us to another hub.
event Hub.PasswordRequestedEventHandler HubPasswordRequested
 Event handler that gets called when a hub requested a password from our client.
event Hub.PrivateChatLineReceivedEventHandler HubPrivateChatReceived
 Event handler that gets called when our client received a private message from a user or bot.
event Hub.UnableToConnectEventHandler HubUnableToConnect
 Event handler that gets called when our client was unable to connect to a hub (this includes errors till we logged in the hub, so unable to connect is not very precise here).
event Hub.UserJoinedEventHandler HubUserJoined
 Event handler that gets called when a user joined a hub.
event Hub.UserQuitEventHandler HubUserQuit
 Event handler that gets called when a user disconnected from a hub.
event Peer.CompletedEventHandler PeerCompleted
 Event handler that gets called when a file download from a peer was completed.
event Peer.ConnectedEventHandler PeerConnected
 Event handler that gets called when a peer connected to our client.
event Peer.DataReceivedEventHandler PeerDataReceived
 Event handler that gets called when some data was received from a peer.
event Peer.DisconnectedEventHandler PeerDisconnected
 Event handler that gets called when a peer disconnected from our client.
event Peer.HandShakeCompletedEventHandler PeerHandShakeCompleted
 Event handler that gets called when a peer finished his initial handshake (TODO this needs some rewriting).

Protected Attributes

List< Hubconnected_hubs = new List<Hub>()
Object connected_hubs_lock = new Object()
Hub.ConnectionMode connection_mode = Hub.ConnectionMode.Passive
string connection_speed = "unknown"
string description = ""
Queue download_queue = new Queue()
string email = "unknown@unknown.net"
ListeningSockets local_peer = new ListeningSockets()
string name = "c#++"
string nick = "unknown"
List< Peerpeers = new List<Peer>()
Object peers_lock = new Object()
SearchResults search_results = new SearchResults()
long share_size = 0
Sharing shares = new Sharing()
string tag_version = "0.698"
string version = "1,0091"

Properties

List< HubConnectedHubs [get]
 a list of connected hubs (deprecated, will soon be only private)
Object ConnectedHubsLock [get, set]
 lock for connected hubs operations thread safety (deprecated ,can cause huge problems)
Hub.ConnectionMode ConnectionMode [get, set]
 the connection mode we want to use active or passive passive should only be used if not port forwarding is possible at all
string ConnectionSpeed [get, set]
 the connection speed of the link which connects this client to the internet
string Description [get, set]
 the user description
Queue DownloadQueue [get]
 our download queue
string Email [get, set]
 the email address of the user
ListeningSockets LocalPeer [get]
 our local peers handling instance
string Name [get, set]
 the name of the client
string Nick [get, set]
 the nickname we want to use
List< PeerPeers [get]
 List of connected peers.
SearchResults SearchResults [get]
 a storage for received search results
Sharing Shares [get]
 our shares to the world
long ShareSize [get, set]
 the total number of shared bytes by the client (TODO change this to return shares.TotalBytesShared)
string TagVersion [get, set]
 the version of the client that is used in the myinfo tag
string Version [get, set]
 the version of the client

Private Member Functions

bool CheckForUserInPeers (string username)
 Check if user is already in connected to us.
void ContinueWithQueueForUser (string username)
 Start the next download in line for a specific user this will search for another queue entry for this user and if found start it (will keep the connection open if we download a whole bunch of files from this guy).
void InterpretReceivedSearchResult (SearchResults.SearchResult result)
 Interpret a received search result (active and passive results can be handled with this method) this will automatically add sources to already existing download queue entries, these will not be shown in the search results TODO make this an option.
Hub ResolveHub (string hub_address)
 Locate a connected hub with help of his address.
void SetupPeerEventHandler (Peer client)
 Setup the event handlers for a fresh connected peer.
void UpdateSourcesByHub (Hub me, bool is_online)
 Update Source Online Status for a specific Hub this will update the online status of the whole user list of the specified hub and try to find the find the affected queue entry sources ,if any.
void UpdateSourcesByUsername (string username, Hub source_hub, bool is_online)
 Update Source Online Status for a specific User on a certain Hub this will update the online status of the user and try to find the find the affected queue entry source ,if there is any.
 ~Client ()
 Client Deconstructor TODO check if deconstructors are really not supported by c#.

Detailed Description

the main class of our library were all spider threads lead together handles most of the tidious work a client has to do

Definition at line 15 of file Client.cs.


Constructor & Destructor Documentation

DCPlusPlus.Client.Client (  ) 

Client Constructor this will setup some event handlers and default options.

Definition at line 832 of file Client.cs.

References DCPlusPlus.SearchResults.DiscardOldResults, DCPlusPlus.Client.download_queue, DCPlusPlus.Queue.DownloadDirectory, DCPlusPlus.Queue.EntrySourceStatusChanged, DCPlusPlus.Queue.FileListsDirectory, DCPlusPlus.Client.GetClientDirectory(), DCPlusPlus.Client.InterpretReceivedSearchResult(), DCPlusPlus.Client.local_peer, DCPlusPlus.Client.PeerConnected, DCPlusPlus.ListeningSockets.PeerConnected, DCPlusPlus.Client.peers, DCPlusPlus.Client.peers_lock, DCPlusPlus.Client.search_results, DCPlusPlus.ListeningSockets.SearchResultReceived, DCPlusPlus.Client.SetupPeerEventHandler(), DCPlusPlus.Client.share_size, and DCPlusPlus.Client.StartDownload().

00833         {
00834 
00835             search_results.DiscardOldResults = true;
00836 
00837             download_queue.EntrySourceStatusChanged += delegate(Queue.QueueEntry entry_changed,Queue.QueueEntry.Source source)
00838             {
00839                 StartDownload(source);
00840             };
00841             
00842             local_peer.SearchResultReceived += delegate(SearchResults.SearchResult result)
00843             {
00844                 InterpretReceivedSearchResult(result);
00845             };
00846 
00847             local_peer.PeerConnected += delegate(Peer client)
00848             {
00849                 SetupPeerEventHandler(client);
00850                 if (PeerConnected != null)
00851                     PeerConnected(client);
00852                 client.StartHandShake();
00853                 lock (peers_lock)
00854                 {
00855                     peers.Add(client);
00856                 }
00857             };
00858 
00859             download_queue.FileListsDirectory = GetClientDirectory() + "\\filelists";
00860             download_queue.DownloadDirectory = GetClientDirectory() + "\\downloads";
00861             share_size = 901 * 1024 * 1024;
00862             share_size = share_size * 1024+523; // until we support sharing .this is just fake to get in to the nicer hubs
00863         }

Here is the call graph for this function:

DCPlusPlus.Client.~Client (  )  [private]

Client Deconstructor TODO check if deconstructors are really not supported by c#.

Definition at line 868 of file Client.cs.

00869         {
00870             //local_peer.Close();
00871 
00872         }


Member Function Documentation

bool DCPlusPlus.Client.CheckForUserInPeers ( string  username  )  [private]

Check if user is already in connected to us.

Parameters:
username the user to check
Returns:
TRUE if the user is connected to us already

Definition at line 593 of file Client.cs.

References DCPlusPlus.Client.peers, and DCPlusPlus.Client.peers_lock.

Referenced by DCPlusPlus.Client.StartDownload().

00594         { //TODO save originating hub in peer and check for hub/username combination
00595             bool ret = false;
00596             lock (peers_lock)
00597             {
00598                 foreach (Peer peer in peers)
00599                 {
00600                     if (peer.PeerNick == username)
00601                     {
00602                         ret = true;
00603                         break;
00604                     }
00605                 }
00606             }
00607             return (ret);
00608         }

Here is the caller graph for this function:

void DCPlusPlus.Client.ConnectHub ( Hub  me  ) 

Connect to a hub this will initialize a hub with some client values like our nickname etc add some event handlers and start connecting to it.

Parameters:
me the hub you want to connect to

Definition at line 881 of file Client.cs.

References DCPlusPlus.Hub.Connect(), DCPlusPlus.Peer.Connect(), DCPlusPlus.Hub.Connected, DCPlusPlus.Peer.Connected, DCPlusPlus.Client.connected_hubs, DCPlusPlus.Client.connected_hubs_lock, DCPlusPlus.Client.connection_mode, DCPlusPlus.Client.connection_speed, DCPlusPlus.Hub.ConnectToMeReceived, DCPlusPlus.Client.description, DCPlusPlus.Hub.Disconnected, DCPlusPlus.Client.email, DCPlusPlus.ListeningSockets.ExternalIP, DCPlusPlus.Sharing.GetShareByTTH(), DCPlusPlus.Client.HubConnected, DCPlusPlus.Client.HubDisconnected, DCPlusPlus.Client.HubLoggedIn, DCPlusPlus.Client.HubMainChatReceived, DCPlusPlus.Client.HubMoveForced, DCPlusPlus.Client.HubPasswordRequested, DCPlusPlus.Client.HubPrivateChatReceived, DCPlusPlus.Client.HubUnableToConnect, DCPlusPlus.Client.HubUserJoined, DCPlusPlus.Client.HubUserQuit, DCPlusPlus.Client.InterpretReceivedSearchResult(), DCPlusPlus.ListeningSockets.IP, DCPlusPlus.Hub.IsGrabbedByClient, DCPlusPlus.Client.local_peer, DCPlusPlus.Hub.LoggedIn, DCPlusPlus.Hub.MainChatLineReceived, DCPlusPlus.Hub.MoveForced, DCPlusPlus.Hub.MyConnectionMode, DCPlusPlus.Hub.MyConnectionSpeed, DCPlusPlus.Hub.MyDescription, DCPlusPlus.Hub.MyEmail, DCPlusPlus.Hub.MyIP, DCPlusPlus.Hub.MyName, DCPlusPlus.Hub.MyShareSize, DCPlusPlus.Hub.MyTagVersion, DCPlusPlus.Hub.MyTcpPort, DCPlusPlus.Hub.MyUdpPort, DCPlusPlus.Hub.MyVersion, DCPlusPlus.Client.name, DCPlusPlus.Client.nick, DCPlusPlus.Connection.Nick, DCPlusPlus.Hub.PasswordRequested, DCPlusPlus.Client.PeerConnected, DCPlusPlus.Client.peers, DCPlusPlus.Client.peers_lock, DCPlusPlus.Hub.PrivateChatLineReceived, DCPlusPlus.Hub.SearchReceived, DCPlusPlus.ListeningSockets.SearchReply(), DCPlusPlus.Hub.SearchReply(), DCPlusPlus.Hub.SearchResultReceived, DCPlusPlus.Client.SetupPeerEventHandler(), DCPlusPlus.Client.share_size, DCPlusPlus.Client.shares, DCPlusPlus.Client.tag_version, DCPlusPlus.ListeningSockets.TcpPort, DCPlusPlus.ListeningSockets.UdpPort, DCPlusPlus.Hub.UnableToConnect, DCPlusPlus.Client.UpdateSourcesByHub(), DCPlusPlus.Client.UpdateSourcesByUsername(), DCPlusPlus.Hub.UserJoined, DCPlusPlus.Hub.UserQuit, and DCPlusPlus.Client.version.

00882         {
00883             me.Nick = nick;
00884             if (!string.IsNullOrEmpty(local_peer.ExternalIP)) me.MyIP = local_peer.ExternalIP;
00885             else me.MyIP = local_peer.IP;
00886             me.MyTcpPort = local_peer.TcpPort;
00887             me.MyUdpPort = local_peer.UdpPort;
00888             me.MyEmail = email;
00889             me.MyDescription = description;
00890             me.MyVersion = version;
00891             me.MyTagVersion = tag_version;
00892             me.MyShareSize = share_size;
00893             me.MyConnectionMode = connection_mode;
00894             me.MyConnectionSpeed = connection_speed;
00895             me.MyName = name;
00896 
00897             if (!me.IsGrabbedByClient)
00898             {
00899                 me.SearchReceived += delegate(Hub search_hub, Hub.SearchParameters search)
00900                 {
00901                     if (search.HasTTH)
00902                     {
00903                         Sharing.SharingEntry entry = shares.GetShareByTTH(search.tth);
00904                         if (entry != null)
00905                         {
00906                             if (search.mode == Hub.ConnectionMode.Passive)
00907                                 search_hub.SearchReply(entry.Filename,entry.Filesize, search);
00908                             else local_peer.SearchReply(entry.Filename,entry.Filesize,search_hub, search);
00909                         }
00910                     }
00911                     else
00912                     {
00913                         //TODO add old fashioned search here
00914                     }
00915 
00916                 };
00917                 me.SearchResultReceived += delegate(Hub search_result_hub, SearchResults.SearchResult result)
00918                     {
00919                         InterpretReceivedSearchResult(result);
00920                     };
00921                 me.PasswordRequested += delegate(Hub password_requested)
00922                 {
00923                     //TODO add a password for hubs db
00924                     // and first check that db before and send a found password
00925                     //automagically and silent
00926                     if (HubPasswordRequested != null)
00927                         return(HubPasswordRequested(password_requested));
00928                     return (null);
00929                 };
00930                 me.MainChatLineReceived += delegate(Hub main_chat_hub, Hub.ChatLine main_chat_line)
00931                 {
00932                     if (HubMainChatReceived != null)
00933                         HubMainChatReceived(main_chat_hub, main_chat_line);
00934                 };
00935                 me.PrivateChatLineReceived += delegate(Hub private_chat_hub, Hub.ChatLine private_chat_line)
00936                 {
00937                     if (HubPrivateChatReceived != null)
00938                         HubPrivateChatReceived(private_chat_hub, private_chat_line);
00939                 };
00940                 me.MoveForced += delegate(Hub src_hub, Hub dst_hub)
00941                 {
00942                     if (HubMoveForced != null)
00943                         HubMoveForced(src_hub, dst_hub);
00944                 };
00945                 me.ConnectToMeReceived += delegate(Hub hub, Peer connect_to_me_client)
00946                 {
00947                     //free slots check maybe needed
00948                     SetupPeerEventHandler(connect_to_me_client);
00949                     connect_to_me_client.Connected += delegate(Peer connect_to_me_connected_client)
00950                     {
00951                         if (PeerConnected != null)
00952                             PeerConnected(connect_to_me_connected_client);
00953                         connect_to_me_connected_client.StartHandShake();
00954                         lock (peers_lock)
00955                         {
00956                             peers.Add(connect_to_me_connected_client);
00957                         }
00958                     };
00959                     connect_to_me_client.Connect();
00960 
00961                 };
00962                 me.Disconnected += delegate(Hub hub)
00963                 {
00964                     UpdateSourcesByHub(hub, false);
00965                     lock (connected_hubs_lock)
00966                     {
00967                         if (connected_hubs.Contains(hub))
00968                             connected_hubs.Remove(hub);
00969                     }
00970                     if (HubDisconnected != null)
00971                         HubDisconnected(hub);
00972                 };
00973                 me.Connected += delegate(Hub hub)
00974                 {
00975                     lock (connected_hubs_lock)
00976                     {
00977                         if (!connected_hubs.Contains(hub))
00978                             connected_hubs.Add(hub);
00979                     }
00980                     if (HubConnected != null)
00981                         HubConnected(hub);
00982                 };
00983                 me.UnableToConnect += delegate(Hub hub)
00984                 {
00985                     UpdateSourcesByHub(hub, false);
00986                     /*lock (connected_hubs_lock) TODO check if commenting this out hurts our code---> :-)
00987                     {
00988                         if (connected_hubs.Contains(hub))
00989                             connected_hubs.Remove(hub);
00990                     }*/
00991                     if (HubUnableToConnect != null)
00992                         HubUnableToConnect(hub);
00993                 };
00994                 me.LoggedIn += delegate(Hub hub)
00995                 {
00996                     if (HubLoggedIn != null)
00997                         HubLoggedIn(hub);
00998                 };
00999                 me.UserJoined += delegate(Hub hub, string username)
01000                 {
01001                     UpdateSourcesByUsername(username, hub, true);
01002                     if (HubUserJoined != null)
01003                         HubUserJoined(hub, username);
01004                 };
01005                 me.UserQuit += delegate(Hub hub, string username)
01006                 {
01007                     UpdateSourcesByUsername(username, hub, false);
01008                     if (HubUserQuit != null)
01009                         HubUserQuit(hub, username);
01010                 };
01011 
01012                 me.IsGrabbedByClient = true;
01013             }
01014             me.Connect();
01015         }

Here is the call graph for this function:

void DCPlusPlus.Client.ContinueWithQueueForUser ( string  username  )  [private]

Start the next download in line for a specific user this will search for another queue entry for this user and if found start it (will keep the connection open if we download a whole bunch of files from this guy).

Parameters:
username the user to search for in our download queue entries sources

Definition at line 616 of file Client.cs.

References DCPlusPlus.Client.download_queue, DCPlusPlus.Queue.FindFirstUnusedQueueEntryBySourceUser(), and DCPlusPlus.Client.StartDownload().

Referenced by DCPlusPlus.Client.SetupPeerEventHandler().

00617         {
00618             //check for existing connection in peers for this user
00619 
00620             if (string.IsNullOrEmpty(username)) return;
00621             Queue.QueueEntry entry = download_queue.FindFirstUnusedQueueEntryBySourceUser(username);
00622             if (entry != null)
00623             {
00624                 StartDownload(entry.FindFirstSourceByUser(username));
00625             }
00626         }

Here is the call graph for this function:

Here is the caller graph for this function:

void DCPlusPlus.Client.DisconnectHub ( Hub  me  ) 

Disconnect a hub this will also remove all event handlers from that hub (TODO this behaviour will cause problems in multi client scenarios,find a workaround).

Parameters:
me the hub you want to disconnect from

Definition at line 1022 of file Client.cs.

References DCPlusPlus.Client.connected_hubs, DCPlusPlus.Client.connected_hubs_lock, DCPlusPlus.Hub.Disconnect(), and DCPlusPlus.Hub.Ungrab().

01023         {
01024             lock (connected_hubs_lock)
01025             {
01026                 connected_hubs.Remove(me);
01027             }
01028             me.Disconnect();
01029             me.Ungrab(); //hub event handlers should be ungrabbed 
01030         }

Here is the call graph for this function:

void DCPlusPlus.Client.FindAlternateSources ( Queue.QueueEntry  me  ) 

Find more sources for a queue entry this will send a tth search to all connected hubs.

Parameters:
me the entry for which to search alternates for

Definition at line 342 of file Client.cs.

References DCPlusPlus.Client.Search().

00343         {
00344             //search all hubs for tth string
00345             if (me != null && me.HasTTH)
00346                 Search(me.TTH, true);
00347         }

Here is the call graph for this function:

Hub DCPlusPlus.Client.FindUserHub ( string  username  ) 

Find the hub to which a user is connected to TODO not implemented.

Parameters:
username the user to look for
Returns:
the hub the user is connected to or NULL if the user is offline

Definition at line 556 of file Client.cs.

00557         {
00558             return (null);
00559         }

string DCPlusPlus.Client.GetClientDirectory (  ) 

Get the directory the client was installed in.

Returns:
the path of the client

Definition at line 631 of file Client.cs.

Referenced by DCPlusPlus.Client.Client().

00632         {
00633             return (Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName));
00634         }

Here is the caller graph for this function:

void DCPlusPlus.Client.GetFileList ( Hub  hub,
string  username 
)

Start getting a file list from a user.

Parameters:
hub the hub which the user is connected to
username the user from which the file list should be downloaded from

Definition at line 387 of file Client.cs.

References DCPlusPlus.Queue.AddFileList(), DCPlusPlus.Client.download_queue, and DCPlusPlus.Hub.SendConnectToMe().

00388         {
00389             download_queue.AddFileList(hub, username);
00390             hub.SendConnectToMe(username); //signal download to hub to start it
00391         }

Here is the call graph for this function:

void DCPlusPlus.Client.GetTTHL ( Queue.QueueEntry  me  ) 

TODO Work in progress.

Parameters:
me 

Definition at line 396 of file Client.cs.

00397         {
00398             //if (me == null) return;
00399             me.WantTTHL = true;
00400             me.StartDownload();
00401         }

void DCPlusPlus.Client.InterpretReceivedSearchResult ( SearchResults.SearchResult  result  )  [private]

Interpret a received search result (active and passive results can be handled with this method) this will automatically add sources to already existing download queue entries, these will not be shown in the search results TODO make this an option.

Parameters:
result the result to be interpreted

Definition at line 356 of file Client.cs.

References DCPlusPlus.SearchResults.AddResult(), DCPlusPlus.Client.download_queue, DCPlusPlus.Queue.FindQueueEntryByTTH(), DCPlusPlus.Client.ResolveHub(), and DCPlusPlus.Client.search_results.

Referenced by DCPlusPlus.Client.Client(), and DCPlusPlus.Client.ConnectHub().

00357         {
00358             //Console.WriteLine("Adding Result to SearchResults");
00359             result.Hub = ResolveHub(result.HubAddress);
00360             if (result.Hub != null) //only add results for hubs still connected
00361             {
00362                 if (result.HasTTH)
00363                 {//only if a result has a tth it is considered a source for some queue entry
00364                     Queue.QueueEntry entry = download_queue.FindQueueEntryByTTH(result.TTH);
00365                     if (entry != null)
00366                     {//this searchresult is also a source for a queue entry 
00367                         //,instead using of giving it back as result we add it to the source pool of the queue entry
00368                         entry.AddSource(new Queue.QueueEntry.Source(result.UserName, result.Filename, result.Hub));
00369 
00370                     } //no queue entry found for this one just hand it over to SearchResults
00371                     else search_results.AddResult(result);
00372                 }
00373                 else search_results.AddResult(result);
00374             }
00375 
00376             /* 
00377                     //Console.WriteLine("Adding Result to SearchResults");
00378                     result.Hub = ResolveHub(result.HubAddress);
00379                     search_results.AddResult(result);
00380             */
00381         }

Here is the call graph for this function:

Here is the caller graph for this function:

Hub DCPlusPlus.Client.ResolveHub ( string  hub_address  )  [private]

Locate a connected hub with help of his address.

Parameters:
hub_address the hub address to look for.In the form of hub.location.com:4133, if the hub port is the default port (411) it can be omitted
Returns:
the found hub or NULL if none exists

Definition at line 516 of file Client.cs.

References DCPlusPlus.Client.connected_hubs, and DCPlusPlus.Client.connected_hubs_lock.

Referenced by DCPlusPlus.Client.InterpretReceivedSearchResult().

00517         {
00518             int port = 411;
00519             string address = "";
00520             try
00521             {
00522                 int port_start = hub_address.IndexOf(":");
00523                 if (port_start != -1)
00524                 {
00525                     address = hub_address.Substring(0, port_start);
00526                     port = int.Parse(hub_address.Substring(port_start + 1));
00527                 }
00528                 else address = hub_address;
00529 
00530             }
00531             catch (Exception ex)
00532             {
00533                 Console.WriteLine("Exception occured during resolving of hub for address: " + hub_address + " - " + ex.Message);
00534                 return (null);
00535             }
00536 
00537             //Console.WriteLine("Searching hubs for ip: "+address + " ,port: "+port);
00538             lock (connected_hubs_lock)
00539             {
00540                 foreach (Hub hub in connected_hubs)
00541                 {
00542                     if (hub.IP == address && hub.Port == port)
00543                     {
00544                         return (hub);
00545                     }
00546                 }
00547             }
00548             return (null);
00549         }

Here is the caller graph for this function:

void DCPlusPlus.Client.Search ( string  search_tth,
bool  is_tth 
)

Search for a tth on all hubs this will send a search request to every connected hub.

Parameters:
search_tth the tth to search for
is_tth Must be TRUE,or else a normal search would be started

Definition at line 321 of file Client.cs.

References DCPlusPlus.Client.connected_hubs, DCPlusPlus.Client.connected_hubs_lock, and DCPlusPlus.Client.Search().

00322         {
00323             if (!is_tth) //better to catch this case ... in case someone is using it 
00324                 Search(search_tth);
00325             else
00326             {
00327                 lock (connected_hubs_lock)
00328                 {
00329                     foreach (Hub hub in connected_hubs)
00330                     {//search on all connected hubs 
00331                         // add filter hubs possibilities
00332                         hub.Search(search_tth, true);
00333                     }
00334                 }
00335             }
00336         }

Here is the call graph for this function:

void DCPlusPlus.Client.Search ( Hub.SearchParameters  sp  ) 

Search for something on all hubs this will send a search request to every connected hub.

Parameters:
sp all search parameters in one single parameter

Definition at line 302 of file Client.cs.

References DCPlusPlus.Client.connected_hubs, DCPlusPlus.Client.connected_hubs_lock, DCPlusPlus.Client.search_results, and DCPlusPlus.SearchResults.SearchTerm.

00303         {
00304             search_results.SearchTerm = sp.search_string;
00305             lock (connected_hubs_lock)
00306             {
00307                 foreach (Hub hub in connected_hubs)
00308                 {//search on all connected hubs 
00309                     // add filter hubs possibilities
00310                     hub.Search(sp);
00311                 }
00312             }
00313         }

void DCPlusPlus.Client.Search ( string  search_string,
bool  size_restricted,
bool  is_max_size,
int  size,
Hub.SearchFileType  file_type 
)

Search for something on all hubs this will send a search request to every connected hub.

Parameters:
search_string the term you want to search for
size_restricted TRUE if you want to restrict your search to a specific size range
is_max_size TRUE if you want to size restrict your search to a max size
size the size you want to use in your size resstriction,only used if size_restricted is set to TRUE
file_type the specific filetype to search for ,default will be ANY

Definition at line 284 of file Client.cs.

References DCPlusPlus.Client.connected_hubs, DCPlusPlus.Client.connected_hubs_lock, DCPlusPlus.Client.search_results, and DCPlusPlus.SearchResults.SearchTerm.

00285         {
00286             search_results.SearchTerm = search_string;
00287             lock (connected_hubs_lock)
00288             {
00289                 foreach (Hub hub in connected_hubs)
00290                 {//search on all connected hubs 
00291                     // add filter hubs possibilities
00292                     hub.Search(search_string, size_restricted, is_max_size, size, file_type);
00293                 }
00294             }
00295         }

void DCPlusPlus.Client.Search ( string  search_string  ) 

Search for something on all hubs this will send a search request to every connected hub.

Parameters:
search_string the term you want to search for

Definition at line 262 of file Client.cs.

References DCPlusPlus.Client.connected_hubs, DCPlusPlus.Client.connected_hubs_lock, DCPlusPlus.Client.search_results, and DCPlusPlus.SearchResults.SearchTerm.

Referenced by DCPlusPlus.Client.FindAlternateSources(), and DCPlusPlus.Client.Search().

00263         {
00264             search_results.SearchTerm = search_string;
00265             lock (connected_hubs_lock)
00266             {
00267                 foreach (Hub hub in connected_hubs)
00268                 {//search on all connected hubs 
00269                     // add filter hubs possibilities
00270                     hub.Search(search_string);
00271                 }
00272             }
00273         }

Here is the caller graph for this function:

void DCPlusPlus.Client.SetupPeerEventHandler ( Peer  client  )  [private]

Setup the event handlers for a fresh connected peer.

Parameters:
client an ungrabbed peer

Definition at line 719 of file Client.cs.

References DCPlusPlus.Peer.Completed, DCPlusPlus.Client.ContinueWithQueueForUser(), DCPlusPlus.Peer.DataReceived, DCPlusPlus.Peer.Disconnected, DCPlusPlus.Client.download_queue, DCPlusPlus.Peer.FileListRequestReceived, DCPlusPlus.Peer.FileRequestReceived, DCPlusPlus.Queue.FindFirstUnusedQueueEntryBySourceUser(), DCPlusPlus.Sharing.GetFileListXmlBZ2(), DCPlusPlus.Sharing.GetShareByFileRequest(), DCPlusPlus.Peer.HandShakeCompleted, DCPlusPlus.Client.nick, DCPlusPlus.Connection.Nick, DCPlusPlus.Client.PeerCompleted, DCPlusPlus.Client.PeerDataReceived, DCPlusPlus.Client.PeerDisconnected, DCPlusPlus.Client.PeerHandShakeCompleted, DCPlusPlus.Peer.PeerNick, DCPlusPlus.Client.peers, DCPlusPlus.Client.peers_lock, DCPlusPlus.Peer.QueueEntry, DCPlusPlus.Queue.Remove(), DCPlusPlus.Client.shares, DCPlusPlus.Peer.UploadFileListData, DCPlusPlus.Peer.UploadFilename, and DCPlusPlus.Peer.UploadRequestFilename.

Referenced by DCPlusPlus.Client.Client(), and DCPlusPlus.Client.ConnectHub().

00720         {
00721             client.Nick = nick;
00722             client.DataReceived += delegate(Peer data_received_client)
00723             {/*
00724                     Queue.QueueEntry entry = download_queue.FindFirstUnusedQueueEntryBySourceUser(data_received_client.PeerNick);
00725                     if (entry != null)
00726                     {
00727                         Queue.QueueEntry.Source source = entry.FindFirstSourceByUser(data_received_client.PeerNick);
00728                         if (source != null)
00729                         {
00730                             entry.IsInUse = true;
00731                         }
00732                         else
00733                         {
00734                             Console.WriteLine("no correct source found in queue entry for user: " + data_received_client.PeerNick);
00735                             data_received_client.Disconnect();
00736                         }
00737                     }
00738                     else
00739                     {
00740                         Console.WriteLine("nothing found in queue for user: " + data_received_client.PeerNick);
00741                         data_received_client.Disconnect();
00742                     }
00743                     */
00744 
00745                 if (PeerDataReceived != null)
00746                     PeerDataReceived(data_received_client);
00747             };
00748 
00749             client.FileListRequestReceived += delegate(Peer file_list_request_client)
00750             {
00751                 if (file_list_request_client.UploadRequestFilename == "files.xml.bz2")
00752                     file_list_request_client.UploadFilename = file_list_request_client.UploadRequestFilename;
00753                 file_list_request_client.UploadFileListData = shares.GetFileListXmlBZ2();
00754                 return (Peer.FileRequestAnswer.LetsGo);
00755             };
00756 
00757             client.FileRequestReceived += delegate(Peer file_request_client)
00758             {
00759                 Sharing.SharingEntry entry = shares.GetShareByFileRequest(file_request_client.UploadRequestFilename);
00760                 if(entry!=null) 
00761                 {
00762                    file_request_client.UploadFilename = entry.Filename;
00763                    return (Peer.FileRequestAnswer.LetsGo);
00764                 }
00765                 else return (Peer.FileRequestAnswer.FileNotAvailable);
00766             };
00767 
00768             client.HandShakeCompleted += delegate(Peer handshake_client)
00769             {
00770                 if (PeerHandShakeCompleted != null)
00771                     PeerHandShakeCompleted(handshake_client);
00772                 Queue.QueueEntry entry = download_queue.FindFirstUnusedQueueEntryBySourceUser(handshake_client.PeerNick);
00773                 if (entry != null)
00774                 {
00775                     Queue.QueueEntry.Source source = entry.FindFirstSourceByUser(handshake_client.PeerNick);
00776                     if (source != null)
00777                     {
00778                         //handshake_client.StartDownload(source.Filename, entry.OutputFilename, entry.Filesize);
00779                         if (entry.Type == Queue.QueueEntry.EntryType.File && entry.WantTTHL)
00780                             handshake_client.GetTTHL(entry);
00781                         else if (entry.Type == Queue.QueueEntry.EntryType.File )
00782                             handshake_client.StartDownload(source, entry);
00783                         else if (entry.Type == Queue.QueueEntry.EntryType.FileList)
00784                             handshake_client.GetFileList(entry);
00785                     }
00786                     else
00787                     {
00788                         Console.WriteLine("no correct source found in queue entry for user: " + handshake_client.PeerNick);
00789                     }
00790                 }
00791                 else
00792                 {
00793                     if (handshake_client.Direction == Peer.ConnectionDirection.Download)
00794                     {
00795                         Console.WriteLine("nothing found in queue for user: " + handshake_client.PeerNick);
00796                         handshake_client.Disconnect();
00797                     }
00798                 }
00799             };
00800 
00801 
00802             client.Completed += delegate(Peer completed_client)
00803             {
00804                 //download_queue.Remove(download_queue.FindQueueEntryByOutputFilename(completed_client.OutputFilename));
00805                 download_queue.Remove(completed_client.QueueEntry);
00806                 ContinueWithQueueForUser(completed_client.PeerNick);
00807                 if (PeerCompleted != null)
00808                     PeerCompleted(completed_client);
00809             };
00810 
00811             client.Disconnected += delegate(Peer disconnected_client)
00812             {
00813                 lock (peers_lock)
00814                 {
00815                     if(peers.Contains(disconnected_client))
00816                         peers.Remove(disconnected_client);
00817                 }
00818                 //Queue.QueueEntry entry = download_queue.FindQueueEntryByOutputFilename(disconnected_client.OutputFilename);
00819                 //Queue.QueueEntry entry = disconnected_client.QueueEntry;
00820                 //if (entry != null) //TODO this will cause trouble -> fix with disconnect cause change in callback
00821                 //    entry.IsInUse = false;
00822                 //ContinueWithQueueForUser(disconnected_client.PeerNick);//TODO prevent hammering on strange source with a seconds counter
00823                 if (PeerDisconnected != null)
00824                     PeerDisconnected(disconnected_client);
00825             };
00826         }

Here is the call graph for this function:

Here is the caller graph for this function:

void DCPlusPlus.Client.StartDownload ( Queue.QueueEntry  me  ) 

Start downloading a queue entry this will send connection requests to every source of the entry.

Parameters:
me the queue entry to start downloading to

Definition at line 460 of file Client.cs.

00461         {
00462 
00463             //TODO change this back to thread safe enumerator in the queue class
00464             if (me == null) return;
00465             me.StartDownload();
00466 
00467 
00468             /*            lock (me.SourcesLock)
00469             {//TODO put this in queue class
00470                 foreach (Queue.QueueEntry.Source source in me.Sources)
00471                 {
00472                     if (source.HasHub && source.IsOnline && !CheckForUserInPeers(source.UserName))
00473                     {
00474                         source.Hub.SendConnectToMe(source.UserName); //signal download to hub to start it
00475                     }
00476                 }
00477             }
00478             //sources strategy 
00479             //for selection and skipping if source offline
00480             //source offline detection
00481 
00482             //result.Hub.SendCommand("ConnectToMe", result.UserName); //signal download to hub to start it
00483             //Console.WriteLine("Hub was not resolved from result hub address: " + result.HubAddress);
00484         */
00485         }

void DCPlusPlus.Client.StartDownload ( Queue.QueueEntry.Source  source  ) 

Start downloading from specific queue entry source this will send a passive or active connection request to a specific user.

Parameters:
source the source to connect to

Definition at line 445 of file Client.cs.

References DCPlusPlus.Client.CheckForUserInPeers().

00446         {
00447             if (source == null) return;
00448 
00449             if (source.HasHub && source.IsOnline && !CheckForUserInPeers(source.UserName))
00450             {
00451                 source.Hub.SendConnectToMe(source.UserName); //signal download to hub to start it
00452             }
00453         }

Here is the call graph for this function:

void DCPlusPlus.Client.StartDownload ( SearchResults.SearchResult  result  ) 

Start downloading a search result ,also adds a queue entry.

Parameters:
result the search result you want to download

Definition at line 430 of file Client.cs.

References DCPlusPlus.Queue.AddSearchResult(), and DCPlusPlus.Client.download_queue.

Referenced by DCPlusPlus.Client.Client(), and DCPlusPlus.Client.ContinueWithQueueForUser().

00431         {
00432             if (result.IsHubResolved)
00433             {//TODO put this into queue class
00434                 download_queue.AddSearchResult(result);
00435                 result.Hub.SendConnectToMe(result.UserName); //signal download to hub to start it
00436             }
00437             else Console.WriteLine("Hub was not resolved from result hub address: " + result.HubAddress);
00438         }

Here is the call graph for this function:

Here is the caller graph for this function:

void DCPlusPlus.Client.StopDownload ( Queue.QueueEntry  me  ) 

Stop downloading a queue entry this will look for a peer using this entry and disconnect it (TODO add a PauseDownload, because this doesnt stop new connections from downloading data for this entry again).

Parameters:
me the queue entry to be stopped

Definition at line 410 of file Client.cs.

References DCPlusPlus.Client.peers, and DCPlusPlus.Client.peers_lock.

00411         {
00412             lock (peers_lock)
00413             {
00414                 foreach (Peer peer in peers)
00415                 {
00416                     if (peer.QueueEntry == me && peer.IsDownloading )
00417                     {
00418                         peers.Remove(peer);
00419                         peer.Disconnect();
00420                         break;
00421                     }
00422                 }
00423             }
00424         }

void DCPlusPlus.Client.UpdateConnectionSettings (  ) 

Update local port bindings needs to be called after the user changed the ports or his external ip.

Definition at line 491 of file Client.cs.

References DCPlusPlus.Client.connected_hubs, DCPlusPlus.Client.connected_hubs_lock, DCPlusPlus.Client.connection_mode, DCPlusPlus.Client.connection_speed, DCPlusPlus.ListeningSockets.ExternalIP, DCPlusPlus.ListeningSockets.IP, DCPlusPlus.Client.local_peer, DCPlusPlus.ListeningSockets.TcpPort, DCPlusPlus.ListeningSockets.UdpPort, and DCPlusPlus.ListeningSockets.UpdateConnectionSettings().

00492         {
00493             local_peer.UpdateConnectionSettings();
00494             lock (connected_hubs_lock)
00495             {
00496                 foreach (Hub hub in connected_hubs)
00497                 {//tell already connected hubs the new ports/ip/etc
00498                     if (!string.IsNullOrEmpty(local_peer.ExternalIP)) hub.MyIP = local_peer.ExternalIP;
00499                     else hub.MyIP = local_peer.IP;
00500                     hub.MyTcpPort = local_peer.TcpPort;
00501                     hub.MyUdpPort = local_peer.UdpPort;
00502                     hub.MyConnectionSpeed = connection_speed;
00503                     hub.MyConnectionMode = connection_mode;
00504                 }
00505             }
00506         }

Here is the call graph for this function:

void DCPlusPlus.Client.UpdateSourcesByHub ( Hub  me,
bool  is_online 
) [private]

Update Source Online Status for a specific Hub this will update the online status of the whole user list of the specified hub and try to find the find the affected queue entry sources ,if any.

Parameters:
me the hub which status has changed
is_online TRUE if you want to set the sources to ONLINE

Definition at line 583 of file Client.cs.

References DCPlusPlus.Client.UpdateSourcesByUsername(), and DCPlusPlus.Hub.UserList.

Referenced by DCPlusPlus.Client.ConnectHub().

00584         {
00585             foreach (string username in me.UserList)
00586                 UpdateSourcesByUsername(username, me, is_online);
00587         }

Here is the call graph for this function:

Here is the caller graph for this function:

void DCPlusPlus.Client.UpdateSourcesByUsername ( string  username,
Hub  source_hub,
bool  is_online 
) [private]

Update Source Online Status for a specific User on a certain Hub this will update the online status of the user and try to find the find the affected queue entry source ,if there is any.

Parameters:
username the user whos status changed
source_hub the hub the user's status changed on
is_online TRUE if the user went ONLINE

Definition at line 572 of file Client.cs.

References DCPlusPlus.Client.download_queue, and DCPlusPlus.Queue.UpdateSourcesByUsername().

Referenced by DCPlusPlus.Client.ConnectHub(), and DCPlusPlus.Client.UpdateSourcesByHub().

00573         {
00574             download_queue.UpdateSourcesByUsername(username, source_hub, is_online);
00575         }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

List<Hub> DCPlusPlus.Client.connected_hubs = new List<Hub>() [protected]

Definition at line 103 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub(), DCPlusPlus.Client.DisconnectHub(), DCPlusPlus.Client.ResolveHub(), DCPlusPlus.Client.Search(), and DCPlusPlus.Client.UpdateConnectionSettings().

Object DCPlusPlus.Client.connected_hubs_lock = new Object() [protected]

Definition at line 87 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub(), DCPlusPlus.Client.DisconnectHub(), DCPlusPlus.Client.ResolveHub(), DCPlusPlus.Client.Search(), and DCPlusPlus.Client.UpdateConnectionSettings().

Hub.ConnectionMode DCPlusPlus.Client.connection_mode = Hub.ConnectionMode.Passive [protected]

Definition at line 146 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub(), and DCPlusPlus.Client.UpdateConnectionSettings().

string DCPlusPlus.Client.connection_speed = "unknown" [protected]

Definition at line 130 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub(), and DCPlusPlus.Client.UpdateConnectionSettings().

string DCPlusPlus.Client.description = "" [protected]

Definition at line 225 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub().

Queue DCPlusPlus.Client.download_queue = new Queue() [protected]

Definition at line 43 of file Client.cs.

Referenced by DCPlusPlus.Client.Client(), DCPlusPlus.Client.ContinueWithQueueForUser(), DCPlusPlus.Client.GetFileList(), DCPlusPlus.Client.InterpretReceivedSearchResult(), DCPlusPlus.Client.SetupPeerEventHandler(), DCPlusPlus.Client.StartDownload(), and DCPlusPlus.Client.UpdateSourcesByUsername().

string DCPlusPlus.Client.email = "unknown@unknown.net" [protected]

Definition at line 210 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub().

event Hub.ConnectedEventHandler DCPlusPlus.Client.HubConnected

Event handler that gets called when our client connected to a hub.

Definition at line 692 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub().

event Hub.DisconnectedEventHandler DCPlusPlus.Client.HubDisconnected

Event handler that gets called when our client was disconnected from a hub.

Definition at line 687 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub().

event Hub.LoggedInEventHandler DCPlusPlus.Client.HubLoggedIn

Event handler that gets called when our client logged into a hub.

Definition at line 682 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub().

event Hub.MainChatLineReceivedEventHandler DCPlusPlus.Client.HubMainChatReceived

Event handler that gets called when our client received some chat from a hub (main chat).

Definition at line 703 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub().

event Hub.MoveForcedEventHandler DCPlusPlus.Client.HubMoveForced

Event handler that gets called when our client received a wish of a hub to move us to another hub.

Definition at line 697 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub().

event Hub.PasswordRequestedEventHandler DCPlusPlus.Client.HubPasswordRequested

Event handler that gets called when a hub requested a password from our client.

Definition at line 714 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub().

event Hub.PrivateChatLineReceivedEventHandler DCPlusPlus.Client.HubPrivateChatReceived

Event handler that gets called when our client received a private message from a user or bot.

Definition at line 709 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub().

event Hub.UnableToConnectEventHandler DCPlusPlus.Client.HubUnableToConnect

Event handler that gets called when our client was unable to connect to a hub (this includes errors till we logged in the hub, so unable to connect is not very precise here).

Definition at line 677 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub().

event Hub.UserJoinedEventHandler DCPlusPlus.Client.HubUserJoined

Event handler that gets called when a user joined a hub.

Definition at line 670 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub().

event Hub.UserQuitEventHandler DCPlusPlus.Client.HubUserQuit

Event handler that gets called when a user disconnected from a hub.

Definition at line 665 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub().

ListeningSockets DCPlusPlus.Client.local_peer = new ListeningSockets() [protected]

Definition at line 65 of file Client.cs.

Referenced by DCPlusPlus.Client.Client(), DCPlusPlus.Client.ConnectHub(), and DCPlusPlus.Client.UpdateConnectionSettings().

string DCPlusPlus.Client.name = "c#++" [protected]

Definition at line 195 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub().

string DCPlusPlus.Client.nick = "unknown" [protected]

Definition at line 115 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub(), and DCPlusPlus.Client.SetupPeerEventHandler().

event Peer.CompletedEventHandler DCPlusPlus.Client.PeerCompleted

Event handler that gets called when a file download from a peer was completed.

Definition at line 655 of file Client.cs.

Referenced by DCPlusPlus.Client.SetupPeerEventHandler().

event Peer.ConnectedEventHandler DCPlusPlus.Client.PeerConnected

Event handler that gets called when a peer connected to our client.

Definition at line 639 of file Client.cs.

Referenced by DCPlusPlus.Client.Client(), and DCPlusPlus.Client.ConnectHub().

event Peer.DataReceivedEventHandler DCPlusPlus.Client.PeerDataReceived

Event handler that gets called when some data was received from a peer.

Definition at line 660 of file Client.cs.

Referenced by DCPlusPlus.Client.SetupPeerEventHandler().

event Peer.DisconnectedEventHandler DCPlusPlus.Client.PeerDisconnected

Event handler that gets called when a peer disconnected from our client.

Definition at line 644 of file Client.cs.

Referenced by DCPlusPlus.Client.SetupPeerEventHandler().

event Peer.HandShakeCompletedEventHandler DCPlusPlus.Client.PeerHandShakeCompleted

Event handler that gets called when a peer finished his initial handshake (TODO this needs some rewriting).

Definition at line 650 of file Client.cs.

Referenced by DCPlusPlus.Client.SetupPeerEventHandler().

List<Peer> DCPlusPlus.Client.peers = new List<Peer>() [protected]

Definition at line 31 of file Client.cs.

Referenced by DCPlusPlus.Client.CheckForUserInPeers(), DCPlusPlus.Client.Client(), DCPlusPlus.Client.ConnectHub(), DCPlusPlus.Client.SetupPeerEventHandler(), and DCPlusPlus.Client.StopDownload().

Object DCPlusPlus.Client.peers_lock = new Object() [protected]

Definition at line 19 of file Client.cs.

Referenced by DCPlusPlus.Client.CheckForUserInPeers(), DCPlusPlus.Client.Client(), DCPlusPlus.Client.ConnectHub(), DCPlusPlus.Client.SetupPeerEventHandler(), and DCPlusPlus.Client.StopDownload().

SearchResults DCPlusPlus.Client.search_results = new SearchResults() [protected]

Definition at line 54 of file Client.cs.

Referenced by DCPlusPlus.Client.Client(), DCPlusPlus.Client.InterpretReceivedSearchResult(), and DCPlusPlus.Client.Search().

long DCPlusPlus.Client.share_size = 0 [protected]

Definition at line 240 of file Client.cs.

Referenced by DCPlusPlus.Client.Client(), and DCPlusPlus.Client.ConnectHub().

Sharing DCPlusPlus.Client.shares = new Sharing() [protected]

Definition at line 76 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub(), and DCPlusPlus.Client.SetupPeerEventHandler().

string DCPlusPlus.Client.tag_version = "0.698" [protected]

Definition at line 180 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub().

string DCPlusPlus.Client.version = "1,0091" [protected]

Definition at line 165 of file Client.cs.

Referenced by DCPlusPlus.Client.ConnectHub().


Property Documentation

List<Hub> DCPlusPlus.Client.ConnectedHubs [get]

a list of connected hubs (deprecated, will soon be only private)

Definition at line 109 of file Client.cs.

Object DCPlusPlus.Client.ConnectedHubsLock [get, set]

lock for connected hubs operations thread safety (deprecated ,can cause huge problems)

Definition at line 93 of file Client.cs.

Hub.ConnectionMode DCPlusPlus.Client.ConnectionMode [get, set]

the connection mode we want to use active or passive passive should only be used if not port forwarding is possible at all

Definition at line 154 of file Client.cs.

string DCPlusPlus.Client.ConnectionSpeed [get, set]

the connection speed of the link which connects this client to the internet

Definition at line 135 of file Client.cs.

string DCPlusPlus.Client.Description [get, set]

the user description

Definition at line 230 of file Client.cs.

Queue DCPlusPlus.Client.DownloadQueue [get]

our download queue

Definition at line 48 of file Client.cs.

string DCPlusPlus.Client.Email [get, set]

the email address of the user

Definition at line 215 of file Client.cs.

ListeningSockets DCPlusPlus.Client.LocalPeer [get]

our local peers handling instance

Definition at line 70 of file Client.cs.

string DCPlusPlus.Client.Name [get, set]

the name of the client

Definition at line 200 of file Client.cs.

string DCPlusPlus.Client.Nick [get, set]

the nickname we want to use

Definition at line 120 of file Client.cs.

List<Peer> DCPlusPlus.Client.Peers [get]

List of connected peers.

Definition at line 36 of file Client.cs.

SearchResults DCPlusPlus.Client.SearchResults [get]

a storage for received search results

Definition at line 59 of file Client.cs.

Sharing DCPlusPlus.Client.Shares [get]

our shares to the world

Definition at line 81 of file Client.cs.

long DCPlusPlus.Client.ShareSize [get, set]

the total number of shared bytes by the client (TODO change this to return shares.TotalBytesShared)

Definition at line 246 of file Client.cs.

string DCPlusPlus.Client.TagVersion [get, set]

the version of the client that is used in the myinfo tag

Definition at line 185 of file Client.cs.

string DCPlusPlus.Client.Version [get, set]

the version of the client

Definition at line 170 of file Client.cs.


The documentation for this class was generated from the following file:
Generated on Wed Mar 7 19:09:26 2007 for DCPlusPlus by  doxygen 1.5.1-p1