Solved

Sendto-Receivefrom buffer size in blocking mode ?

Posted on 1997-06-18
4
682 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
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

We recently endured a series of broadcast storms that caused our ISP to shut us down for brief periods of time. After going through a multitude of tests, we determined that the issue was related to Intel NIC drivers on some new HP desktop computers …
Resolve DNS query failed errors for Exchange
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

939 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

10 Experts available now in Live!

Get 1:1 Help Now