- introduced <controller> actions function for listing actions
- introduced <controller> reconnect function
This commit is contained in:
19
ascon.c
19
ascon.c
@ -313,7 +313,7 @@ int AsconBaseHandler(Ascon * a)
|
||||
} else if (ret > 0) {
|
||||
a->state = AsconConnectDone; /* success */
|
||||
} else if (ret < 0) {
|
||||
AsconError(a, "ASC3", errno);
|
||||
AsconError(a, "ASC3", errno);
|
||||
}
|
||||
break;
|
||||
case AsconWriteStart:
|
||||
@ -584,6 +584,23 @@ void AsconDisconnect(Ascon * a)
|
||||
{
|
||||
if (a->fd > 0) {
|
||||
close(a->fd);
|
||||
lastClose = DoubleTime();
|
||||
}
|
||||
a->fd = -1;
|
||||
a->state = AsconNotConnected;
|
||||
}
|
||||
|
||||
void AsconReconnect(Ascon * a, char * hostport)
|
||||
{
|
||||
if (a->fd > 0) {
|
||||
close(a->fd);
|
||||
lastClose = DoubleTime();
|
||||
}
|
||||
if (hostport != NULL && hostport[0] != '\0') {
|
||||
if (a->hostport) {
|
||||
free(a->hostport);
|
||||
}
|
||||
a->hostport = strdup(hostport);
|
||||
}
|
||||
a->fd = -1;
|
||||
a->state = AsconConnectStart;
|
||||
|
Reference in New Issue
Block a user