Search Results - CodeGuru Forums
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Patry20

Search: Search took 0.00 seconds.

  1. Replies
    20
    Views
    806

    Re: Winsock - sending a picture failed.

    Yes, that did the trick! Finally got it working! :)

    Thank you guys for your time, you've been a great help. :wave:
  2. Replies
    20
    Views
    806

    Re: Winsock - sending a picture failed.

    Yes, that's why I asked:


    I tried strcat:



    [...]
    char *bufor2;
    bufor2 = (char*)malloc(sizeof(char)* size);
  3. Replies
    20
    Views
    806

    Re: Winsock - sending a picture failed.

    FILE *PlikSave; char *bufor; char FileSize[6] = { 0 }; int BytesReceived, size, BytesReceivedTemp=0;
    BytesReceived= recv(MojSocket, FileSize, sizeof(FileSize), NULL);
    size= atoi(FileSize);
    bufor...
  4. Replies
    20
    Views
    806

    Re: Winsock - sending a picture failed.

    Okay, so with your advise @VictorN, I added new variable "BytesReceivedTemp" and set that to 0, and added while loop.


    while(BytesReceivedTemp!=270398)
    {
    BytesReceived=recv(MojSocket,...
  5. Replies
    20
    Views
    806

    Re: Winsock - sending a picture failed.

    Well, I think it is fairly simple algorithm. Get file size -> Send file size - > Receive file size. Send file -> Receive file -> Save file.
    I just don't know why 'recv' receives only 24464 bytes,...
  6. Replies
    20
    Views
    806

    Re: Winsock - sending a picture failed.

    No, there is one that doesn't match a value.
    Server sends 6 bytes (size number), Client receives 6 bytes. -Correct
    Server sends 270398 bytes (whole file), Client receives 24464 - Incorrect!
    So,...
  7. Replies
    20
    Views
    806

    Re: Winsock - sending a picture failed.

    I've checked every recv and send for SOCKET_ERROR, and there was no errors.
  8. Replies
    20
    Views
    806

    Re: Winsock - sending a picture failed.

    @VictorN - Thank you, will remember next time to add Code tags. I deleted checking for a return values, because I wanted the code to be clearer (yes, now I see this is not the best option :D)
    ...
  9. Replies
    20
    Views
    806

    Winsock - sending a picture failed.

    Hello. I'm trying to send a picture using Winsock. The problem is, that it sends approximately 30% of a picture, the rest is blank.

    Second problem is, the Client.exe should return to the main...
Results 1 to 9 of 9


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center