hi all..
please check the code below..
in i am trying to connect a http server to send an email..
i had given buffer size of 1KB which seems to be enough for mail..
now i want to try to send voice over this media using H.323 protocols..
i am using G.711 as voice encoding algoritim..
i want to know the following things..
1.is it possible to increase the buffer size considerebly without any network
constraints?
2.if yes what will be its effect on its quality?
3.my purpose is to make a wifi based intercom facility with all regular features
4.what will be the approximate decrese in the size of the voice file while using
H.323 and G.711 as the protocols?
5.i had gone to many sites on net for H323 but i want some more data on the
instruction set/commands used in H323.please help me..
6.I am begineer in socket programming.i want to know how this
application program
(voice coding) is get interfaced with the valid socket.
7.if possible,please give me some sample codes so that i can helpmyself.
8.Last,but not the least..this group gave me the confidence to work on
this project
allmost independently..i am especially thankful to Peter and Ray
for their valuble comments..and all those who took the trouble to
reply me..
I hope i made some improvement since my last mail to this group.
**********
code
**********
WSADATA wsaData;
memset(&wsaData, 0, sizeof(WSADATA));
if(WSAStartup(MAKEWORD(1,1), &wsaData) != 0)
return FALSE;
SOCKET s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if(s == INVALID_SOCKET) {
int iSocketError = WSAGetLastError();
return FALSE;
}
HOSTENT *hostServer = gethostbyname("www.microsoft.com");
if(hostServer == NULL) {
int iSocketError = WSAGetLastError();
return FALSE;
}
SOCKADDR_IN sinServer;
memset(&sinServer, 0, sizeof(SOCKADDR_IN));
sinServer.sin_family = AF_INET;
sinServer.sin_port = htons(80);
sinServer.sin_addr =
*((IN_ADDR *)hostServer>h_addr_list[0]);
if(connect(s, (SOCKADDR *)&sinServer, sizeof(sinServer)) ==
SOCKET_ERROR) {
int iSocketError = WSAGetLastError();
return FALSE;
}
char cBuffer[1024] = "";
int nBytesSent = 0;
int nBytesIndex = 0;
sprintf(cBuffer, "GET / HTTP/1.0\r\n\r\n");
int nBytesLeft = strlen(cBuffer);
while(nBytesLeft > 0) {
nBytesSent = send(s, &cBuffer[nBytesIndex], nBytesLeft, 0);
if(nBytesSent == SOCKET_ERROR)
break;
nBytesLeft -= nBytesSent;
nBytesIndex += nBytesSent;
}
TCHAR tchResponseBuffer[1024] = TEXT("\0");
char cResponseBuffer[1024] = "";
BOOL fBreak = FALSE;
int nBytesReceived = 0;
while(!fBreak) {
nBytesReceived = recv(s, &cResponseBuffer[0], 1024, 0);
if(nBytesReceived == SOCKET_ERROR)
break;
mbstowcs(tchResponseBuffer, cResponseBuffer, nBytesReceived);
MessageBox(NULL, tchResponseBuffer, TEXT("Web Output"), MB_OK);
if(_tcsstr(tchResponseBuffer, TEXT("\r\n\r\n")))
fBreak = TRUE;
// Clear the buffers
memset(tchResponseBuffer, 0, 1024);
memset(cResponseBuffer, 0, 1024);
}
closesocket(s);
WSACleanup();
To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/c-prog/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/