Is IPv6 C++-oriented?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Is IPv6 C++-oriented?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Is IPv6 C++-oriented?  
Alex Vinokur


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-22-06 11:11 PM

IPv4
----
char* buffer = malloc (len);
int recv(int s, void *buffer, size_t len, int flags);

To use recv() in IPv4 we should allocate buffer of maximum allowed size
before calling recv().

On other hand, C++ STL enables us to fill buffer without allocating
memory before calling functions (for instance, using stringstream)


Does IPv6 use such a property of C++?

In this case the recv6() might be as follows:

// No memory allocation.
int recv6 (int s, stringstream* ss, int flags);


Alex Vinokur
email: alex DOT vinokur AT gmail DOT com
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn






[ Post a follow-up to this message ]



    Re: Is IPv6 C++-oriented?  
Nils O. Selåsdal


Report This Message To A Moderator Edit/Delete Message


 
01-22-06 11:11 PM

Alex Vinokur wrote:
> IPv4
> ----
> char* buffer = malloc (len);
> int recv(int s, void *buffer, size_t len, int flags);
>
> To use recv() in IPv4 we should allocate buffer of maximum allowed size
> before calling recv().
>
> On other hand, C++ STL enables us to fill buffer without allocating
> memory before calling functions (for instance, using stringstream)
>
>
> Does IPv6 use such a property of C++?
IPv6 is a protocol, it's not directly related to a specific programming
language.

The standard BSD socket API is a C API ,and is quite similar for ipv4
and ipv6. Search for a library for C++ that has the feature you want,
maybe someone has constructed such a library.






[ Post a follow-up to this message ]



    Re: Is IPv6 C++-oriented?  
Alex Colvin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-30-06 02:32 AM

examnotes  <noselasd@asgaard.removethis.ho
melinux.org> writes:
[vbcol=seagreen] 


Not really.
The c++ library classes reallocate the buffer and copy the data as the
buffer grows. That means these operations are usually fast, but now and
then they have to do a lot of extra work.

When you've got messages streaming in off the wire, there's simply no time
for that.

Perhaps more significantly, the data stream has to know intimate details
of the buffer management software. The kernel protocol stack doesn't know
this about your application. You could build an operating system that was
this tightly integrated, but you'd have to rebuild the kernel everytime
you updated a library.

The usual way to hide this is to pre-allocate a maximum-size buffer and
then, once the data is in, reallocate it to the size actually used.

--
mac the naïf





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:54 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register