Solved

Sendto-Receivefrom buffer size in blocking mode ?

Posted on 1997-06-18
4
674 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
  • 2
4 Comments
 

Expert Comment

by:jdunlop
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Trying to figure out group policy inheritance and which settings apply where can be a chore.  Here's a very simple summary I've written which might help.  Keep in mind, this is just a high-level conceptual overview where I try to avoid getting bogge…
I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now