- SECoP protocol for scriptcontext

This commit is contained in:
2018-05-07 13:53:51 +02:00
parent da2b8c13d4
commit 19b3c71274
15 changed files with 288 additions and 27 deletions

10
ascon.c
View File

@ -150,9 +150,11 @@ static void AsconConnect(Ascon * a)
ret = CreateSocketAdress(&adr, a->hostport, port);
*colon = ':';
if (ret == 0) {
a->ip = 0;
AsconError(a, "bad host specification", 0);
return;
}
a->ip = adr.sin_addr.s_addr;
oldopts = fcntl(a->fd, F_GETFL, 0);
fcntl(a->fd, F_SETFL, oldopts | O_NONBLOCK);
ret =
@ -853,6 +855,14 @@ char *AsconHostport(Ascon *a)
return a->hostport;
}
unsigned long AsconIP(Ascon *a)
{
if (a==NULL) {
return 0;
}
return a->ip;
}
double AsconGetSetTimeout(Ascon *a, double timeout, int setmode) {
if (setmode) {
a->timeout = timeout;