How to get a port number bound to a given socket using function other than getsockname()
-
Hello, Is there any way to get port number bound to a given socket using the socket descriptor. I dont want to use getsockname(). Thanks in advance.
Gajendra
-
Hello, Is there any way to get port number bound to a given socket using the socket descriptor. I dont want to use getsockname(). Thanks in advance.
Gajendra
Why don't you want to use
getsockname()
.«_Superman_» I love work. It gives me something to do between weekends.
-
Why don't you want to use
getsockname()
.«_Superman_» I love work. It gives me something to do between weekends.
Thanks for your response. the problem is getsockname() sometimes fails due the following microsoft issue: http://support.microsoft.com/kb/319952[^]
Gajendra
-
Thanks for your response. the problem is getsockname() sometimes fails due the following microsoft issue: http://support.microsoft.com/kb/319952[^]
Gajendra
I think you should use it because the site also talk about the resolution for the failure.
«_Superman_» I love work. It gives me something to do between weekends.
-
I think you should use it because the site also talk about the resolution for the failure.
«_Superman_» I love work. It gives me something to do between weekends.
I want to avoid the complexity associated with WSADuplicateSocket. I just want to pass the port number across processes, thats my only requirement. I need some mechanism through which i can get socket number in parent process and pass it to the child process as an argument. By parent process i mean process that invokes the second process, which i call the child process.
Gajendra
-
I want to avoid the complexity associated with WSADuplicateSocket. I just want to pass the port number across processes, thats my only requirement. I need some mechanism through which i can get socket number in parent process and pass it to the child process as an argument. By parent process i mean process that invokes the second process, which i call the child process.
Gajendra
Don't duplicate the socket at all. Get the port number using the socket descriptor. And pass this port number to the child process as a command line argument.
«_Superman_» I love work. It gives me something to do between weekends.
-
u mean using Get the port number using getsockname()?
Gajendra
Yes, without duplicating the socket.
«_Superman_» I love work. It gives me something to do between weekends.
-
Don't duplicate the socket at all. Get the port number using the socket descriptor. And pass this port number to the child process as a command line argument.
«_Superman_» I love work. It gives me something to do between weekends.
u mean using Get the port number using getsockname()?
Gajendra
-
I think you should use it because the site also talk about the resolution for the failure.
«_Superman_» I love work. It gives me something to do between weekends.
5
. :-DIf the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Yes, without duplicating the socket.
«_Superman_» I love work. It gives me something to do between weekends.
Thanks for your answer!!!
Gajendra