Results 1 to 6 of 6

Thread: need help on winsock control

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    5

    need help on winsock control

    hai,
    using winsock control (UDP protocal) i am receiving data and processing. everything is ok when the datagram/packet size is small. but if the datagram/packet size is more like 10kb i am getting an error saying "the datagram is too big to fit into buffer...." how to solve this error. i cannot change the code on other side to reduce the datagram/packet size. if i have to increase the winsock control buffer size how to do that ? because the same data i am able to recive by a patch program written in VC. is it possible to use winsock api insted of winsock control? , if so how to call the api and what are the all api

    thanking you

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: need help on winsock control

    You cant send packets over winsock that are too big. Keep your packets at like 2 - 5 kb (Thats the figure if i rmember correctly)

    Then you send lots of packets and when they ahve all been sent the cleint re-builds the file.

    Hope that helps

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    5

    Re: need help on winsock control

    if the transmit program is mine then i can do some thing. but here i can't do any thing. i have to receive the big block which is of 10k in size. is there any way to change default buffer size ( at present it is 8191 bytes). thank you

  4. #4
    Frenzied Member
    Join Date
    Aug 2000
    Location
    O!
    Posts
    1,177

    Re: need help on winsock control

    Based on the error message that you are getting, it sounds like you are having a Maximum Transmission Unit (MTU) issue. Here is a description of the MTU and how it relates to packets, datagrams, etc.

    You can find info on adjusting the MTU here and here.

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    5

    Re: need help on winsock control

    thankyou very much for your reply.
    My problem is i had a telemetry receiver(i can't do any changes to this ) which transmits the received data in blocks of 10 KB(10,245 is the block size) in LAN. in my receive program i opened a winsock control (UDP protocal) and trying to read it. i am getting an error saying "data gram is too large and it is truncated". if i am debugging no bytes read is showing 8191. this means it is reading only 8191 bytes trunkating remaining bytes. another thing is i am not facing any problem with the block size while transmission. the problem is only when i am receiving.so i am thinking that default buffer size is 8191 for reception. i need to read the whole block which is of 10245 bytes in size. so is there any way to solve this problem. by changing the MTU value will there won't be any other side effects?. insted of going to registry and change is there any API call avilable to change the buffer size for recption.

  6. #6
    Frenzied Member
    Join Date
    Aug 2000
    Location
    O!
    Posts
    1,177

    Re: need help on winsock control

    Ah, so you are seeing the error message on the receiving side. I guess that wasn't clear to me.

    See if this MSDN link helps. Check out the info on setsockopt.

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