|
@ -366,13 +366,17 @@ Jupiter::Socket *Jupiter::Socket::accept() |
|
|
r->data_->sockType = Jupiter::Socket::data_->sockType; |
|
|
r->data_->sockType = Jupiter::Socket::data_->sockType; |
|
|
r->data_->sockProto = Jupiter::Socket::data_->sockProto; |
|
|
r->data_->sockProto = Jupiter::Socket::data_->sockProto; |
|
|
r->data_->host.set(resolved); |
|
|
r->data_->host.set(resolved); |
|
|
char *end = resolved + r->data_->host.size(); |
|
|
switch (addr.sa_family) |
|
|
while (end != resolved) |
|
|
|
|
|
{ |
|
|
{ |
|
|
if (*--end == ':') |
|
|
case AF_INET: |
|
|
break; |
|
|
r->data_->port = ntohs(reinterpret_cast<sockaddr_in *>(&addr)->sin_port); |
|
|
r->data_->port *= 10; |
|
|
break; |
|
|
r->data_->port += static_cast<unsigned char>(Jupiter_getBase(*end, 10)); |
|
|
case AF_INET6: |
|
|
|
|
|
r->data_->port = ntohs(reinterpret_cast<sockaddr_in6 *>(&addr)->sin6_port); |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
r->data_->port = 0x00000000; |
|
|
|
|
|
break; |
|
|
} |
|
|
} |
|
|
return r; |
|
|
return r; |
|
|
} |
|
|
} |
|
|