This command shuts down the specified
instance or shuts down all instances and unloads the networking module.
Note that the instance is reset to its
default state so any commands that change an instance setting e.g. mnSetLocal,
mnDisableUDP will be reversed.
When the instance parameter is not -1 mnFinish does the following:
- Shuts down the instance. The instance
can then be reinitialized using mnConnect (client state), mnStartServer
(server state) or mnStartBroadcast (broadcast state).
When the instance parameter is -1 mnFinish does the following:
- Shuts down all instances
- Unloads the DarkNet networking module.
mnStart can then be reused to restart DarkNet at a later point.
You should ensure that mnFinish(-1) is
used before your application exits so that sockets are not left open.
DarkGDK users: you can ensure that mnFinish
is executed even if the user clicks on the red X by placing mnFinish
at the end of your code. When DGDK exits it will run through all of
your code until it reaches the end.
DarkBASIC Pro users: You do not need
to worry about mnFinish being executed before exit, this is done automatically.
int Instance: This is the instance that the command should use. Set this to -1 to use mnFinish on all instances and unload the networking module.
0 if no error occurred
-1 if an error occurred.
DBP
C++
.Net