Re: Send TIFF w TransmitFile recv with WSARecv

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Additionally, seems you parser work wrong because you have to receive all
the data ( ascii or not )
Arkady

"JJ" <jj@xxxxxxxxxx> wrote in message
news:elJFALIOGHA.532@xxxxxxxxxxxxxxxxxxxxxxx
Are you calling WSARecv in a loop? You are not guaranteed to receive all
of the data in one call. You have to check l_bytesRecvd to see how much
data was received and keep calling WSRecv until all of the data is
received.

As far as I know, TransmitFile does not care about the data transferred.
Are you writing it to a file on the receiver side? Are you using a file
I/O call on that side that would care about the content?

"Joachim" <Joachim@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:40CE93CD-2BDE-426C-BA44-0616D1ABB9BA@xxxxxxxxxxxxxxxx
I seem only to get the readable (ascii I think) characters when
transfering a
TIFF image file from one computer (using TransmitFile) and receiving on
the
other (using WSARecv) as follows:

Sender:
=========
HANDLE l_hFile = CreateFile("tiffImg.tif, GENERIC_READ, 0, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (l_hFile == INVALID_HANDLE_VALUE)
{
throw MyException();
}

if (TransmitFile(socket, l_hFile, 0, 1023, NULL, NULL, NULL) == FALSE)
{
throw MyException();
}

CloseHandle(l_hFile);
=========

Receiver:
=========
const unsigned int l_recvBufLen = 1024;
char l_buf[l_recvBufLen];
memset(l_buf, 0, l_recvBufLen);
WSABUF WSAbuf;
WSAbuf.buf = l_buf;
WSAbuf.len = l_recvBufLen - 1;
DWORD l_flags = 0;
DWORD l_bytesRecvd;

WSARecv(clientSock, &WSAbuf, 1, &l_bytesRecvd, &l_flags, &l_overlapped,
NULL);

=========

Any ideas of the cause and how I can solve the problem? I suspect I
should
receive the data in another way, but I don't know how.




.



Relevant Pages

  • Re: Send TIFF w TransmitFile recv with WSARecv
    ... Are you calling WSARecv in a loop? ... TransmitFile does not care about the data transferred. ... Are you writing it to a file on the receiver side? ... DWORD l_bytesRecvd; ...
    (microsoft.public.win32.programmer.networks)
  • Re: Whats a good LONG lasting shortwave radio...
    ... care of it. ... It is not in the same class as a 'real' receiver with multiple filters, ... bit of care and capacitor replacement, but tend to be a tad large and heavy. ... probably still be a reliable receiver a hundred years from now, ...
    (rec.radio.shortwave)
  • Re: You people make me sick
    ... > Or maybe they view him as a rented receiver and not as a team-mate. ... He don't care about the Eagles. ... > ever, but since it's a team sport, no matter what he does on the field, he ...
    (alt.sports.football.pro.phila-eagles)
  • Re: Ready To Buy Another
    ... i haven't heard it but i suspect it would be impressive, particularly if you thought the stock panasonic in your '91 was ok. ... What I find unacceptable about the Clarion selected in '06, assuming that the odd form was truly a defense against thieves, is that it left out desirable features while locking the buyer into using their receiver only. ... You'll have so much fun driving the car that you won't care about the radio. ...
    (rec.autos.makers.mazda.miata)
  • Re: Way to go Pelosi!
    ... say -- police, military, education and health care. ... I was trying to locate a receiver with a mono-mode ... a mono switch is really the only ... When I'd attached the antennas to that receiver, ...
    (soc.retirement)