Audiovox P965 Arkusz Danych Strona 225

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 280
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 224
API in C
222
/********************************************************************
* Write a word to the socket
********************************************************************/
void writeWord(int fdSock, char *szWord)
{
DEBUG ? printf("Word to write is %s\n", szWord) : 0;
writeLen(fdSock, strlen(szWord));
write(fdSock, szWord, strlen(szWord));
}
/********************************************************************
* Write a sentence (multiple words) to the socket
********************************************************************/
void writeSentence(int fdSock, struct Sentence *stWriteSentence)
{
int iIndex;
if (stWriteSentence->iLength == 0)
{
return;
}
DEBUG ? printf("Writing sentence\n"): 0;
DEBUG ? printSentence(stWriteSentence) : 0;
for (iIndex=0; iIndex<stWriteSentence->iLength; iIndex++)
{
writeWord(fdSock, stWriteSentence->szSentence[iIndex]);
}
writeWord(fdSock, "");
}
/********************************************************************
* Read a message length from the socket
*
* 80 = 10000000 (2 character encoded length)
* C0 = 11000000 (3 character encoded length)
* E0 = 11100000 (4 character encoded length)
*
* Message length is returned
********************************************************************/
Przeglądanie stron 224
1 2 ... 220 221 222 223 224 225 226 227 228 229 230 ... 279 280

Komentarze do niniejszej Instrukcji

Brak uwag