BCB Mailing List
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [BCB] How can I send the data by UDP in C++ builder?
I don't see how what data you wish to send via UDP matters, since UDP
is a plain-jane packet protocol.
If you want to send data via UDP in C++Builder you can look at the
NMUDP component included with C++ builder, or some 3rd party
shareware components like fpiette's WSocket.
to send data with TNMUDP:
drop one onto your form from the internet tab (microphone icon).
Set the localport property if you wish to receive data (design time)
At runtime, set the remotehost property to the DNS name, or IP
address of the machine you want to send data to.
Set the remoteport property to the port number that the machine you
are sending data to is listening on (it's "localport")
Call sendbuffer (char *data, int len) or sendsteam (tstream)
the receiving machine's ondatarecieved event will occur, from within
there call readbuffer or readstream. if using readbuffer, make sure
the buffer is large enough to hold the entire block that was sent.
notes on UDP: data is *not* reliably delivered, and packets may arrive
at the receiving end in a order different than they were sent in
(this only happens across a fair amount of internet distance, where
each packet could take significantly different routes). Windows has a
hard time reliably receiving a steady stream of UDP large packets at
ethernet data rates without dropping some of the fragments, thus I
would recommend smallish sendbuffer() calls (not much over 576 bytes
for dialups, or 1460 for ethernet lan).
> Sorry if I have missed something here (been away for a few weeks) but, what
> data do you want to send?
>
> Peter
>
> > How can I send the data by UDP in C++ builder?
W Komornicki's Home Page |
Main Index |
Thread Index