vb.net - Socket property that returns IP address/Port -



vb.net - Socket property that returns IP address/Port -

i trying string representation of ip address , port socket has been initialized with. using info print in message box user if error occurs.

using winsock command in vb6 next code used:

"could not open tcp connection " & frmmain.winsock1.remotehost & ":" & frmmain.winsock1.remoteport

any help @ appreciated.

the socket not know remote ip/port until connects server. have provide destination connect() method first. if connect() fails, have know destination provided can study it, cannot query socket it. if connect asynchronously, have remember destination somewhere can retrieve when needed.

however, if connect() succeeds, can query remoteendpoint property actual ip/port socket connected to. particularly useful when connecting hostname, find ip address hostname resolved to.

vb.net sockets ip-address

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -