Results 1 to 4 of 4

Thread: Winsock - problem sending a large amount of data

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    67

    Winsock - problem sending a large amount of data

    Hi there, I am creating a small program to send a picture using winsock.
    So far the app that is sending the data, as far as I can see is working fine. I am storing the RGB value of each pixel in a 2d array as follows:

    VB Code:
    1. width = picture1.width
    2. height = picture1.height
    3. dim picArray(width, height) as long
    4. for x = 0 to width
    5. [INDENT]for y = 0 to height[/INDENT]
    6. [INDENT]picArray(x,y), picture1.point(x,y)[/INDENT]
    7. [INDENT]sck.senddata picArray(x,y)[/INDENT]
    8. [INDENT]next[/INDENT]
    9. next

    If I run a similar loop in the same program to display the data from the array using PSet, the picture displays fine, however when I send the data to the other program it only recieves upto x = 4, the rest of the array has been assigned an RGB value of the same value when x = 4 and the last value of y.

    I have tried to send it as a string with a comma as a delimiter, but again it only sends data upto x = 4.

    I was thinking maybe there is a limit on how big the data can be??

    Any suggestion would be appreciated

    Regards

  2. #2
    Hyperactive Member Arachnid13's Avatar
    Join Date
    Jan 2003
    Location
    England
    Posts
    327

    Re: Winsock - problem sending a large amount of data

    there is indeed a limit on how much data can be sent through a winsock senddata function, it should still send all the data, just in chunks, so you need to reconstruct the data on the recieving system
    Do you wake up in the morning feeling sleepy and grumpy? Then you must be Snow White

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    67

    Re: Winsock - problem sending a large amount of data

    So for example;

    VB Code:
    1. dim incomeData as long
    2. dim incomeDataArr(width, height)
    3. for x = 0 to width
    4. [INDENT]for y = 0 to height[/INDENT]
    5. [INDENT]sck.getdata incomeData[/INDENT]
    6. [INDENT]incomeDataArr(x,y) = incomeData[/INDENT]
    7. [INDENT]next[/INDENT]
    8. next

    Regards

  4. #4
    Member
    Join Date
    Oct 2001
    Posts
    47

    Re: Winsock - problem sending a large amount of data

    Placing a DoEvents after each senddata has worked for me in the past.

    Also, might I suggest using SetPixelV and GetPixel API's in place of pset and point. There's an incredible performance increase.

    Hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width