+ if ((bind_ret= bind(sd, (struct sockaddr *)&sin, sizeof(struct sockaddr_in) )) != SOCKET_ERROR)
+ {
+ socklen_t addrlen= sizeof(sin);
+
+ if (getsockname(sd, (struct sockaddr *)&sin, &addrlen) != -1)
+ {
+ ret_port= sin.sin_port;
+ }
+ }
+ else
+ {
+ if (errno != EADDRINUSE)
+ {
+ Error << strerror(errno);
+ }
+ }