Accessibility

TechNote

Peer-to-Peer connection failure with the Multiuser Xtra

Issue


When establishing a Peer-to-Peer connection with the Multiuser Xtra the following error appears:

"There is no current connection (-2147216214)"

Reason


This error is usually caused because aWaitNetMsgHandlerhandler has not been created in the host movie. Whenever a client movie tries to connect to a host movie, the host movie must tell the Xtra to allow the connection. To verify that the connection is valid, a handler must be created to process the Xtra's request.

Solution


Before the host movie starts waiting for a net connection, a handler must be defined to process the validation request from the Multiuser Xtra. This handler will return either TRUE for an accepted connection request or FALSE for a rejected request.

Here is an example for setting the handler:

 errCode = gMultiuserInstance.setNetMessageHandler(#WaitNetMsgHandler, Script "Host", "WaitForNetConnection", "System") 

Below is an example of aWaitNetMsgHandlerhandler. The handler below first sets a temporary variable namedretValueto FALSE. The handler will then verify that the Multiuser Xtra has been instantiated. If the Xtra has been instantiated, then the handler then checks for any errors, and then setsretValueto TRUE. Finally, the handler returns the value ofretValueto the Xtra.

 on WaitNetMsgHandler me 
		
retValue = FALSE if ( gMultiuserInstance <> 0 ) then
msgList = gMultiuserInstance.GetNetMessage()
if ( msgList.errorCode <> 0 ) then
alert "Connection test failed:"&& msgList.errorCode else retValue = TRUE
end if
end if
return retValue
end WaitNetMsgHandler

Additional information
For a more in-depth example of this handler please refer to Peer connection examples using the Director Multiuser Xtra (TechNote 13796).



AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the free Flash Player now!

Get Adobe Flash Player

Creative Commons License

Search Support


Document Details

ID:tn_14660

Products Affected: