Audiovox P965 Arkusz Danych Strona 124

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 280
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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];
Przeglądanie stron 123
1 2 ... 119 120 121 122 123 124 125 126 127 128 129 ... 279 280

Komentarze do niniejszej Instrukcji

Brak uwag