hi, is there a way to know how much data is received ?
i will try to put thoses RcvBuf on both side to see if it work.Beacuse when i call the Received function, it always return 1460. even if i put a count larger than that. regards Jonathan ----- Original Message ----- From: "Wilfried Mestdagh" <[EMAIL PROTECTED]> To: "ICS support mailing" <[email protected]> Sent: Wednesday, January 31, 2007 1:39 PM Subject: Re: [twsocket] streaming video client/server application > Hello Jonathan, > >> j'avais oublier que tu parlais francais:) > > Yes and some other too here. But the list is English, so many people > will not understeand and can also not answer then :( So better stay in > English :) > >> Merci pour les infos. Je vais changer BufSize pour 65535. j'ai besoin de >> faire les 2 ? ou juste Bufsize ? > > The other one (RcvdCount) is not a setting. It was just a reminder to > not rely on it. > > --- > Rgds, Wilfried [TeamICS] > http://www.overbyte.be/eng/overbyte/teamics.html > http://www.mestdagh.biz > > Wednesday, January 31, 2007, 19:21, Jonathan Dumaresq wrote: > >> Bonjour Francois, > >> j'avais oublier que tu parlais francais:) > >> Merci pour les infos. Je vais changer BufSize pour 65535. j'ai besoin de >> faire les 2 ? ou juste Bufsize ? > >> merci > >> Jonathan >> ----- Original Message ----- >> From: "Francois PIETTE" <[EMAIL PROTECTED]> >> To: "ICS support mailing" <[email protected]> >> Sent: Wednesday, January 31, 2007 12:13 PM >> Subject: Re: [twsocket] streaming video client/server application > > >>> >>> You should also set TWSocket own buffer size (Default to 1460). >>> frmTestCarteDSPR->udpServer->BufSize = 65536; >>> >>>> maxlength = udpClient->RcvdCount; >>> >>> Do not rely on RcvdCount which - as Microsoft said - is not always >>> accurate. >>> Just receive as much data as you can into your buffer. Normally since >>> UDP >>> is >>> a datagram service, you'll get complete datagrams at once. >>> >>> PS: On peut aussi me joindre sur le forum >>> news://news.delphinaute.be/delphi >>> -- >>> Participez à l'effort SSL pour ICS. Visitez >>> http://www.overbyte.be/eng/ssl.html >>> -- >>> [EMAIL PROTECTED] >>> Auteur du freeware ICS - Internet Component Suite >>> Auteur du middleware multi-tiers MidWare >>> http://www.overbyte.be >>> >>> >>> ----- Original Message ----- >>> From: "Jonathan Dumaresq" <[EMAIL PROTECTED]> >>> To: <[email protected]> >>> Sent: Wednesday, January 31, 2007 5:13 PM >>> Subject: [twsocket] streaming video client/server application >>> >>> >>>> HI, >>>> >>>> I try to make a streaming video client server application using thr >>>> TWsocket component. >>>> >>>> I think i have some probleme with handling all the data that is comming >>>> on >>>> the client part. On my server part, I have a callback function that if >>>> fired as soon as i have a video frame is ready. this card is a mpeg4 >>>> compressor card, so the data fram is variable. From 248 bytes to 30K or >>>> 40K. So I send it in UDP. This server is a multi streaming server I can >>>> stream up to 4 channel. since i have only 1 callback for all the >>>> channel >>>> i >>>> can't do it in a thread (i think). So i do this every thime i received >>>> a >>>> frame: >>>> >>>> I have put a TWsocket on the form. >>>> >>>> frmTestCarteDSPR->udpServer->Proto = "udp"; >>>> frmTestCarteDSPR->udpServer->Addr = >>>> frmTestCarteDSPR->infoConnection[channelNum].ipAddr; // ip addr to the >>>> remote host >>>> frmTestCarteDSPR->udpServer->Port = >>>> frmTestCarteDSPR->infoConnection[channelNum].ipPort; // remote port >>>> frmTestCarteDSPR->udpServer->Connect(); >>>> size = 65535; >>>> setsockopt(frmTestCarteDSPR->udpServer->HSocket, SOL_SOCKET , >>>> SO_SNDBUF, >>>> (const char *)&size, sizeof(size)); // change the socket buffer to >>>> 65535 >>>> frmTestCarteDSPR->udpServer->Send((unsigned char *)DataBuf,Length); >>>> // >>>> send data >>>> frmTestCarteDSPR->udpServer->Close(); // close the socket >>>> >>>> I would like to know if this is a good way of doing it ??? is ther a >>>> simple way or a better way of doing this ? >>>> >>>> >>>> on the client part, i do this in the udpClientDataAvailable >>>> >>>> maxlength = udpClient->RcvdCount; >>>> //debugStream << "data received = " << maxlength << endl; >>>> frame = new uint8_t[maxlength]; >>>> while(byteread < maxlength) >>>> { >>>> Len = udpClient->Receive(&frame[byteread],1460); >>>> byteread += Len; >>>> } >>>> // I continue the job for displaying the video. >>>> >>>> is there a better way of doing this ? is it possible to receive all the >>>> data without looping ? >>>> >>>> regards >>>> >>>> Jonathan >>>> >>>> -- >>>> To unsubscribe or change your settings for TWSocket mailing list >>>> please goto http://www.elists.org/mailman/listinfo/twsocket >>>> Visit our website at http://www.overbyte.be >>> >>> -- >>> To unsubscribe or change your settings for TWSocket mailing list >>> please goto http://www.elists.org/mailman/listinfo/twsocket >>> Visit our website at http://www.overbyte.be >>> > > > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://www.elists.org/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
