From DCppWiki



Active user

$Search <ip>:<port> <searchstring>

Passive user

$Search Hub:<requestornick> <searchstring>


This command is used to initiate a search. The format used differs based on whether the client is in active mode or passive mode.

Active User Request:

  • <ip> is this client's own IP address.
  • <port> is a UDP port on which the client is listening for responses.

Passive User Request:

  • <requestornick> is the Nick of the Passive User doing the Search.

<searchstring> is a string describing the file the client is searching for. It is made up of a question mark ('?') delimited string as follows:

  • <sizerestricted> is 'T' if the search should be restricted to files of a minimum or maximum size, otherwise 'F'.
  • <ismaxsize> is 'F' if <sizerestricted> is 'F' or if the size restriction places an lower limit on file size, otherwise 'T'.
  • <size> is the minimum or maximum size of the file to report (according to <ismaxsize>) if <sizerestricted> is 'T', otherwise 0.
  • <datatype> restricts the search to files of a particular type. It is an integer selected from:
    • 1 for any file type
    • 2 for audio files ("mp3", "mp2", "wav", "au", "rm", "mid", "sm")
    • 3 for compressed files ("zip", "arj", "rar", "lzh", "gz", "z", "arc", "pak")
    • 4 for documents ("doc", "txt", "wri", "pdf", "ps", "tex")
    • 5 for executables ("pm", "exe", "bat", "com")
    • 6 for pictures ("gif", "jpg", "jpeg", "bmp", "pcx", "png", "wmf", "psd")
    • 7 for video ("mpg", "mpeg", "avi", "asf", "mov")
    • 8 for folders
  • <searchpattern> is used by other users to determine if any files match.
  • Behavior of DC++:
    • Spaces are replaced by '$'.
    • As with all NMDC messages, '$' and '|' are escaped with "&#36;" and "&#124;", with '&' being further replaced with "&amp;"

The server must forward this message unmodified to all the other users. Every other user with one or more matching files must send a UDP packet to <ip>:<port> for Active requests or a reply to the Hub for Passive requests.

See the $SR command for details of response format.


$Search T?T?500000?1?Gentoo$2005
$Search Hub:SomeNick T?T?500000?1?Gentoo$2005