6 * Copyright (C) 1987 by the Massachusetts Institute of Technology
8 * This routine is part of the client library. It handles
9 * creating a connection to the sms server.
13 static char *rcsid_sms_connect_c = "$Header$";
16 #include "sms_private.h"
19 * Open a connection to the sms server.
26 if (!sms_inited) sms_init();
27 if (_sms_conn) return SMS_ALREADY_CONNECTED;
30 * XXX should do a hesiod call to find the sms machine name & service
34 _sms_conn = start_server_connection(SMS_GDB_SERV, "");
35 if (_sms_conn == NULL)
37 if (connection_status(_sms_conn) == CON_STOPPED) {
38 register status = connection_errno(_sms_conn);
48 _sms_conn = sever_connection(_sms_conn);
56 struct sms_params *params = NULL;
57 struct sms_params *reply = NULL;
61 params->sms_procno = SMS_NOOP;
63 params->sms_argl = NULL;
64 params->sms_argv = NULL;
66 if ((status = sms_do_call(params, &reply)) == 0)
67 status = reply->sms_status;
69 sms_destroy_reply(reply);
78 * c-continued-statement-offset: 4