nn::dlp::CTR::ServerWithName::Initialize Member Function

Syntax

static nn::Result Initialize(
     bool * pNotice,
     nn::Handle eventHandle,
     u8 maxClientNum,
     u8 childIndex,
     void * pBuffer,
     size_t bufferSize,
     size_t blockBufferSize = MIN_NETWORK_BLOCK_BUFFER_SIZE *2,
     size_t blockBufferNum = MIN_NETWORK_BLOCK_BUFFER_NUM,
     nn::cfg::UserName * pUserName = NULL
);

Parameters

Name Description
out pNotice Returns true if message display is required. For details, see the Description section on this page.
in eventHandle Specifies a handle to the nn::os::Event object, waiting for a signal from Download Play. Initialize the event in the application. Use the GetEventDesc function to get the event information.
in maxClientNum Specifies the maximum number of clients (from 1 to MAX_CLIENT_NUM) that can connect to the server.
in childIndex Specify the index (the RSF ChildIndex) of the child program to distribute. You can specify a value between 0 and 255. (A server can have up to 256 children.)
in pBuffer Pointer to the DLP working buffer. Must be 4096-byte aligned.
in bufferSize Size of working buffer. Must be 4096-byte aligned.
in blockBufferSize This is the size of the block buffer, when data that has been read from a file is kept before sending. Specify a size that is greater than or equal to MIN_NETWORK_BLOCK_BUFFER_SIZE, and less than or equal to MAX_NETWORK_BLOCK_BUFFER_SIZE.
in blockBufferNum This is the number of block buffers. Specify a number greater than or equal to MIN_NETWORK_BLOCK_BUFFER_NUM, and less than or equal to MAX_NETWORK_BLOCK_BUFFER_NUM.
in pUserName Specifies the user name. Handle the user name according to UGC guidelines and information given on this page. The user name set in system settings is used if NULL is specified here.

Return Values

The following Result values are returned as the result of the operation.

Value Description
ResultSuccess Initialization was successful.
ResultInvalidPointer pBuffer is either NULL or not 4096-byte aligned.
ResultOutOfRange maxClientNum, bufferSize, blockBufferSize, and blockBufferNum are invalid.
ResultInvalidHandle eventHandle is invalid.
ResultAlreadyOccupiedWirelessDevice The wireless device is already occupied for another purpose. Exit the other wireless process.
ResultInternalError An irrecoverable error occurred internally.
ResultWirelessOff Communication is impossible (the system is in Sleep Mode or wireless-disabled mode).
ResultInvalidMediaType The media type of the parent device is not supported.
ResultFailedToAccessMedia Cannot access the media. The child program may not be properly installed on the parent or a card may have been removed.
ResultChildTooLarge The child program exceeds the standard import size (MAX_CHILD_IMPORT_SIZE).
ResultInvalidRegion The child program and the system have different regions.

Description

Initializes the server by specifying a user name.

This function is the same as nn:dlp::Server::Initialize, with the added ability to set a user name.
Precautions regarding user names are described here.
A check is made whether the user name given by pUserName (the userName member of nn::cfg::UserName) follows UGC guidelines. If it includes profanity, set the profanity flag (the isNgUserName member of nn:cfg::UserName) to true.
If the profanity flag has been set to true, do not do anything to hide the profanity, just pass it to this function unaltered.
Note, however, that the user name specified with this function can be obtained as node information, so when displaying the obtained user name together with other node information to a user, be sure to follow the guidelines for the profanity flag and process appropriately.
The reason the system needs to display user names by looking at the profanity flag is so that behavior matches download play of built-in system applications.
You must therefore follow the instruction given here.

Revision History

2012/01/20
Initial version.
2012/04/12
Deleted the explanation about ResultInvalidMediaType.

CONFIDENTIAL