how to get port number
-
hi all i want to know that how can i know the system port number as i need it for socket programming thanks
-
hi all i want to know that how can i know the system port number as i need it for socket programming thanks
thanks for ur answer sir i use this code on a button but port which is in bold does not work so please tell me what port number i should use CAsyncSocket m_sListener, m_sConnected; UpdateData(TRUE); m_sListener.Create(port); if(m_sListener.Listen()==FALSE) { AfxMessageBox("Unable to Listen on that port,please try another port"); m_sListener.Close(); return; } m_sConnected.Create(); m_sConnected.Connect("10.179.22.75",port); if( m_sListener.Listen()== FALSE) { AfxMessageBox("Unable to Listen ,please try another port"); m_sListener.Close(); return; } thanks
-
thanks for ur answer sir i use this code on a button but port which is in bold does not work so please tell me what port number i should use CAsyncSocket m_sListener, m_sConnected; UpdateData(TRUE); m_sListener.Create(port); if(m_sListener.Listen()==FALSE) { AfxMessageBox("Unable to Listen on that port,please try another port"); m_sListener.Close(); return; } m_sConnected.Create(); m_sConnected.Connect("10.179.22.75",port); if( m_sListener.Listen()== FALSE) { AfxMessageBox("Unable to Listen ,please try another port"); m_sListener.Close(); return; } thanks
p_ wrote:
...port which is in bold does not work...
Which is all but totally meaningless.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
thanks for ur answer sir i use this code on a button but port which is in bold does not work so please tell me what port number i should use CAsyncSocket m_sListener, m_sConnected; UpdateData(TRUE); m_sListener.Create(port); if(m_sListener.Listen()==FALSE) { AfxMessageBox("Unable to Listen on that port,please try another port"); m_sListener.Close(); return; } m_sConnected.Create(); m_sConnected.Connect("10.179.22.75",port); if( m_sListener.Listen()== FALSE) { AfxMessageBox("Unable to Listen ,please try another port"); m_sListener.Close(); return; } thanks
Guy, if you don't know the port number of the service you're trying to connect to on the server, we're not going to be able to tell you. After all, you haven't said anything about this service so we don't know what it is you're trying to connect to!
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007