Hi! Currently I am writing data from my application via WriteFile to my UMDF USB driver and send the stuff over bulk endpoints. I'd like to send only single USB frames from my application to my device. Is there a way to break the data stream from the application into USB frames without applying an own transfer protocol (e.g. packet length, packet data...)? Since USB has such a protocol (framing) I think it is rather annoying to implement a new framing protocol on top of it just to make sure that my app. receives and sends only single USB frames. Any ideas? Thanks!
Dee Veloper
Posts
-
UMDF USB driver: application stream into USB frames -
Tcp/Ip send() does sometimes not succeedI guess I have to think through my code step by step once again. At least I know now, that send() should send after 200ms as long as the connection is established. Thanks again for your help! Flo
-
Tcp/Ip send() does sometimes not succeedmaxRead is the maximum number of bytes the buffer can store. if recvMsgSize is smaller than maxRead (which is normally the case) I copy the data to additional buffers and combine them as soon as all bytes are received. With my problem the data received is always smaller than maxRead.
-
Tcp/Ip send() does sometimes not succeedThanks for your help so far Mark. I hope this code snippet gives you an idea for a solution: TIMEVAL tv; tv.tv_sec=0; tv.tv_usec=5; FD_ZERO(&clientSet); FD_SET(theClient->sock,&clientSet); if ((errCode=select(0,&clientSet,NULL,NULL,&tv))>0) { if ((recvMsgSize=recv(theClient->sock,addBuffer,maxRead,0))<=0) { //error handling ... } else message handling... I do not receive an error or a message. Select() returns only timeout. Flo
-
Tcp/Ip send() does sometimes not succeedI checked the number of bytes received and sent. The problem is that the send command really does not send anything (I observed my network traffic) but tells me it has sent the correct amount of bytes. I doublechecked with breakpoints and everything I can think of and I have no idea why it does not send anything. The other side is listening with select and no data is to be received. This happens only sometimes. Normally it works fine. Frustrating :( Flo
-
Tcp/Ip send() does sometimes not succeedHi! I am currently programming server/client stuff with the c++ functions send and recv. Normally everything works fine but sometimes the client tells me it has sent a message successfully but it is not received by the server. I tracked the packets in the network and no packet had been sent. Documentation says not every successful call to send() guarantees that the data is received by the client. Unfortunately the packet is never sent (waited up to 3 minutes). Since Tcp/Ip is a reliable protocol, I expected the packets to be received by the client as long as the connection is not terminated. How can I make sure that send really sends my data? Is there a flush() command? (using Tcp/Ip non blocking windows socket, checking for send/receive with select). Any help would be greatly appreciated!!! Thx Flo P.S. Before you ask: it has to be c++ send and recv - no MFC or C# stuff...