Audiovox P965 Arkusz Danych Strona 66

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 280
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 65
API in C using winsock
63
cEncodedLength[2] = cLength[2];
cEncodedLength[3] = cLength[3];
}
send (fdSock, cEncodedLength, 4, 0);
}
else // this should never happen
{
printf("length of word is %d\n", iLen);
printf("word is too long.\n");
exit(1);
}
}
/********************************************************************
* 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));
send(fdSock, szWord, strlen(szWord), 0);
}
/********************************************************************
* 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]);
}
Przeglądanie stron 65
1 2 ... 61 62 63 64 65 66 67 68 69 70 71 ... 279 280

Komentarze do niniejszej Instrukcji

Brak uwag