Audiovox P965 Scheda Tecnica Pagina 124

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 280
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 123
API In CPP
121
address.sin_port = htons(port);
addressSize = sizeof(address);
DEBUG ? printf("Connecting to %s\n", strIpAddress.c_str()) : 0;
connectResult = connect(fdSock, (struct sockaddr *)&address, addressSize);
if(connectResult==-1) {
perror ("Connection problem");
Disconnect();
fdSock = -1;
} else {
DEBUG ? printf("Successfully connected to %s\n", strIpAddress.c_str()) : 0;
}
// determine endianness of this machine
// iLittleEndian will be set to 1 if we are
// on a little endian machine...otherwise
// we are assumed to be on a big endian processor
littleEndian = IsLittleEndian();
}
/********************************************************************
* Disconnect from API
* Close the API socket
********************************************************************/
void MikrotikAPI::Disconnect()
{
if(fdSock != -1) {
DEBUG ? printf("Closing socket\n") : 0;
close(fdSock);
}
}
/********************************************************************
* Login to the API
* 1 is returned on successful login
* 0 is returned on unsuccessful login
********************************************************************/
int MikrotikAPI::Login(const string &strUsername, const string &strPassword)
{
Sentence readSentence;
Sentence writeSentence;
md5_state_t state;
md5_byte_t digest[16];
Vedere la pagina 123
1 2 ... 119 120 121 122 123 124 125 126 127 128 129 ... 279 280

Commenti su questo manuale

Nessun commento