Migration services: Difference between revisions

No edit summary
Line 349: Line 349:
No input, returns an [[#IAsyncContext|IAsyncContext]].
No input, returns an [[#IAsyncContext|IAsyncContext]].


The async task does the following:
The async task does the following (handling any errors as needed / calling any logging funcs as needed):
* ...
* ...
* Initializes the data used for the AdvertiseData.
* Initializes the data used for the AdvertiseData.
Line 362: Line 362:
** Uses [[LDN_services|SetAdvertiseData]] with buf/size = 0 (empty AdvertiseData).
** Uses [[LDN_services|SetAdvertiseData]] with buf/size = 0 (empty AdvertiseData).
** Uses [[LDN_services|SetStationAcceptPolicy]] with value 1 (AlwaysReject).
** Uses [[LDN_services|SetStationAcceptPolicy]] with value 1 (AlwaysReject).
** Enters a loop waiting for a state field to become value 0x3. Two funcs are called repeatedly in this loop, with cleanup and return being handled if these return error.
** Enters a loop waiting for a state field to become value 0x3 (network message [[#Initialize|Initialize]]/[[#Initialize|Initialize2]] handled). Two funcs are called repeatedly in this loop. These essentially receive [[#Messages|messages]] + process them, and send the response network message.
*** The first func receives socket data and handles it. The second func calls a func to get data for sending, then sends the socket data. Both have timeout etc handling.
** Updates state and returns 0.
** Updates state and returns 0.
* ...
* Calls a vfunc. When the ret is true:
** Calls a func, which receives [[#ClientProfileNetwork|ClientProfileNetwork]] and sends the response. Also calls a func to process the received data.
** Receives [[#Data|Data]] message 0x10 and sends the response.
* Otherwise when the vfunc ret is false:
** Calls a func identical to the first network-message func called in the above block, except a different func is called at the end.
** Runs the same [[#Data|Data]] message 0x10 handling as above.
** Calls a func. This calls a func, then receives [[#Data|Data]] message 0x12 and sends the response.
** Calls a func. This runs functionality similar to the eariler message-loop, except this waits for the state field to change to !=0x3. The socket is closed, then a func is called which handles [[LDN_services|ldn]] + [[Sockets_services|sockets]] cleanup.
** Calls a func. This essentially calls the network-creation func from eariler, with the input AdvertiseData being 0x10-bytes.
** Calls a func. This receives [[#Suspend|Suspend]] or [[#SynchronizeState|SynchronizeState]] and sends the response.
* Updates a state flag and returns 0.


=== WaitAcceptanceAsync ===
=== WaitAcceptanceAsync ===