char[]! in ExHeap expath = Bitter.FromString2(path);
rootds.SendBind(expath, service_exp);
switch receive
{
case rootds.AckBind():
// SmbDebug.WriteLine("Successfully bound to service: " + path);
delete rootds;
break;
case rootds.NakBind(ServiceContract.Exp:Start exp, ErrorCode code):
if (exp != null)
delete exp;
delete rootds;
throw new Exception(String.Format("The request to bind to the service '{0}' failed. "
+ "The directory service refused the bind request: {1}.",
path, SdsUtils.ErrorCodeToString(code)));
case rootds.NakBindReparse(char[]! in ExHeap expath_out, char[] in ExHeap rest, bool linkFound, ServiceContract.Exp:Start! exp):
delete expath_out;
if (rest != null)
delete rest;
delete exp;
delete rootds;
throw new Exception(String.Format("The request to bind to the service '{0}' failed. "
+ "The directory service returned a reparse request, which is not currently supported.", path));
case rootds.ChannelClosed():
delete rootds;
throw new Exception(String.Format("The request to bind to the service '{0}' failed. The directory service closed the channel.", path));
case unsatisfiable:
delete rootds;
throw new Exception(String.Format("The request to bind to the service '{0}' failed. The select is unsatisfiable.", path));
}
#if false
SmbDebug.WriteLine("Waiting for service to indicate that it is ready...");
switch receive
{
case service_imp.Ready():
SmbDebug.WriteLine("Service indicates it is ready.");
break;
case service_imp.ChannelClosed():
throw new Exception(String.Format("The request to bind to service '{0}' failed. The service closed the channel without indicating that it was ready.", path));
case unsatisfiable:
throw new Exception(String.Format("The request to bind to service '{0}' failed. The service closed the channel without indicating that it was ready.", path));
}
#endif
}
public static ServiceProviderContract.Exp! RegisterService(string! path)