Solved

Sendto-Receivefrom buffer size in blocking mode ?

Posted on 1997-06-18
4
699 Views
Last Modified: 2013-12-23
Hi all,

I'm working with winsock api (wsock32.dll), in UDP blocking mode. First, it seems you cannot receive a buffer more than 30 000 bytes, although you can send correctly the same buffer, "sendto()" returns Ok after sending 30 000 bytes but the distant host who have made an "receivefrom()" is always in the blocking mode. Second, even if the distant host can receive 20 000 bytes buffer size, sometimes to time, the host is blocked again on "receivefrom()".

Can you explain this ? What are the limits of winsock ?

Thank you
0
Comment
Question by:mars
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Expert Comment

by:jdunlop
ID: 1545284
It seems to me you'd be better off asking this
in a programming area. (If this was linked to
from a programming area, I apologize).
0
 
LVL 3

Accepted Solution

by:
hpierson earned 100 total points
ID: 1545285
When you do a WSAStartup, a WSAData structure is returned that show many of the specifics of the local winsock. You may want to examine it.

Also, be aware that there a re application buffers as well as system network buffers. Just because your application can send a large buffer, it doesn't mean that the entire message is going in a single packet.

Quoting from Windows Sockets Network Programming by Bob Quinn (ISBN 0-201-63372-8 Published by Addison Wesley - my single best source of Winsock information) you should think in terms of MTU - maximum Transmittable Units. (pg 430)

"On UDP,  it is possible to send any size datagram, and IP handles fragmentation and reassembly. This is not advisable, however for a number of reason....worst of all, if the local or remote network-systems do not have adequate buffer space availalabe the operation may fail _without an error_, since datagrams  are unreliable."

"We recommend using no more than 1460 (bytes) for TCP and 1472 for UDP. These match the MTU sizes of...and are a common value for the negotiated MSS. This maximizes efficiency for the common case."

Read this book - it is full of practical as well as theoretical information.


Harry M. Pierson
DREJ Consulting
0
 

Author Comment

by:mars
ID: 1545286
you confirm the facts, yes, i known the size of data in a single packet form 46 bytes to about 1500, but i come from unix world and the winsock (TCP/IP) interface does not work like in unix.
My question is : What is the network interface used by Windows  to exchange file between hosts for instance ? Does it use UDP with less than 1500 bytes per packet ? I want it to known because windows send very fastly large buffer.
0
 
LVL 3

Expert Comment

by:hpierson
ID: 1545287
My understading is that the Client for Microsoft Networks uses NetBeui, even if you have other protocols installed. If so, this is what is used for all file transfer.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nslookup is a command line driven utility supplied as part of most Windows operating systems that can reveal information related to domain names and the Internet Protocol (IP) addresses associated with them. In simple terms, it is a tool that can …
Resolve DNS query failed errors for Exchange
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question