i lost almost my entire knowledge about this stuff and want to
refresh some things :) i still know how to handle the apis but
there are a few things that i never intuited or forgot. oh, i'm
talking about winsock :)


what is "bandwith" AND how do i know how much "bandwith"
I have, can i calculate it somehow?

how many bytes can i send via an open socket and is it limited?
(i suppose this is related to bandwith but can someone explain
this in detail?)

is upd faster than tcp/ip? i don't need reliablility so...

when do i have to use the "bind" cmd... i think i must use it
for listening sockets but i found no informations about this.


okay, thats it for now, i hope someone can clear the fog for
me...
Posted on 2002-07-10 06:02:25 by mob
Bandwith = the amount of data (usually in bits) you can send per second.. normally you will get a peak value... like 100Mb/s for a 100Base-X lan or example...

the amount of bytes you can send through a socket is limited to your bandwith... if your not send or recieving anything you should be able to send your peak bandwith/8 Bytes, iirc, wich gives us 12.5MB/s in said 100Base-X lan... then again that probably never will happen..

UDP is somewhat faster faster than TCP... but from my eperience it's hardly noticable..i might be wrong here

as far s i know you need to use bind for listening ports... not 100% sure there
Posted on 2002-07-10 08:05:22 by NervGaz
yes Bind is used to associate a socket with a local port so you would do this if you wanted a socket to listen on a particular port. You can also bind to a local port if you want your outgoing connection to come from a particular port but I see no reason to do this.
Posted on 2002-07-10 10:53:05 by Kudos
Actually, UDP is faster than TCP, because it has got less protocol overhead. But you won't really notice this, because the packets themself are big enough and because of that the protocol overhead becomes nearly unimportant (Not quite sure about this).
Posted on 2002-07-10 12:14:03 by nyook
thank you very much for the fast responses... most things
are clear now... but one things left, is there any way to get
the bandwith or the connection-type (modem, cable, ...)
exactly? or should i always use a fixed bandwith. i mean
is it okay when i'm just passing 64k in every case to the
"send" command? and what happens when i try to send
one mb for example as one big chunk, will winsock split up
this block for me on itself?
Posted on 2002-07-10 17:01:48 by mob
mob, you're confusing bandwith (line speed) and maximum acceptable
data size. For TCP, the IP stack will fragment your message into
acceptable datagrams, so theoretically you should be able to send
any size (I don't know if winsock has any limit), but in practice
it's better to send multipler smaller messages, so you can do more
fine-grained error control etc. Also, you can't always be sure the
entire data buffer is sent at once; at least not if you use async
sockets - I believe that blocking sockets will always have sent all
the data when send() returns - or there has been an error.
Posted on 2002-07-10 19:42:59 by f0dder