Solved

Sendto-Receivefrom buffer size in blocking mode ?

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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

FIPS stands for the Federal Information Processing Standardisation and FIPS 140-2 is a collection of standards that are generically associated with hardware and software cryptography. In most cases, people can refer to this as the method of encrypti…
A common practice in small networks is making file sharing easy which works extremely well when intra-network security is not an issue. In essence, everyone, that is "Everyone", is given access to all of the shared files - often the entire C: drive …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

807 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