SCTP. V4 v. V6 addresses...
SCTP. V4 v. V6 addresses...
- Subject: SCTP. V4 v. V6 addresses...
- From: J P May <email@hidden>
- Date: Sun, 1 Aug 2010 11:19:38 +0200
Hi Andreas,
Just don't forget that UDP packets can get lost and could be
processed in reverse order..
UDP is perfect for loss tolerant stuff such as video streaming where
the loss of a frame is not the end of the world. But it would be a
very bad design choice to use it for financial transactions.
For sure ..
The modern SCTP would give you both benefits of TCP and UDP but
Apple says we can't have it (yet?).
Fascinating - I had not heard of it. I will look in to it, thanks.
By the way for TCP (not udp), I stumbled on to another well-written
library (one file), AsyncSocket by Dustin Voss.
http://homepage.mac.com/d_j_v/FileSharing4.html I guess everyone
here would know it already but there it is.
Here is an interesting (well to me) question about socket addresses.
As you know you get the hostname, port from a socket address using getnameinfo.
in typical network code, people check that it is not a IP4 address
wrapped in an IP6 address. There is a perfect example of this in
apple's UDPEcho library example app ...
// If it's a IPv4 address embedded in an IPv6 address, just bring it as an IPv4
// address....
the writer then goes on to do this ...
if ([address length] >= sizeof(struct sockaddr_in6)) {
.. // point "A"
if (addr6Ptr->sin6_family == AF_INET6) {
..
if ( IN6_IS_ADDR_V4MAPPED(&addr6Ptr->sin6_addr) ||
IN6_IS_ADDR_V4COMPAT(&addr6Ptr->sin6_addr) ) {
and in that case, he or she squashes over the ip4-in-ip6 info to the
normal record, and then just calls getnameinfo normally.
No problem so far !
However, what I'm curious about is .......
IN WHAT SITUATIONS would you get to "point A" in the code above?
I have tried every possible combo of macs, fones, old and new OSs,
etc. I can never, ever get the code to go to Point A (far less get
to the IN6_IS_ADDR_V4MAPPED test)
{Of course, iPhones have no IP6 if I understand the situation correctly.}
Are IP4 addresses embedded in IPV6 just mythical / hyopthetical?
Something to do with WIndows? :) Flash?? :)
what sort of machine?? would you have connected to trigger that
condition, ([address length] >= sizeof(struct sockaddr_in6)) ??
What's the deal there -- does anyone know about this?
I suppose a broader simpler question is, does getnameinfo always
reliably give you individual, different hosts/services for all the
different things connected to you, or do you have to concern yourself
distinctly with the IP4 IP6 duality ?
It seems to work flawlessly, but I can't trigger the condition the
Apple DTS author seemed to deal with specifically (they were after a
human readable string) in that example.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden