Async sockets

  • Thread starter Thread starter Frane Roje
  • Start date Start date
F

Frane Roje

I'm trying to connect to a server using non-blocking sockets with the method
Socket.BeginConnect(). Since I don't know the Ip address of my server I
can't get the IPEndPpoint parameter for the BeginConnect() method. Could
someone tell me how to get the IP address of server if you know it's
name(example: mail.htnet.hr)?

--
Frane Roje

Have a nice day

Remove (d*el*ete) from email to reply
 
Hi Frane,

You can get the IP Address of a server from a name by calling the function

Dns.GetHostByName in System.Net name space. You can then build the EndPoint
using this IP address.

HTH,
-Krishna
e-mail : krishkp <at> comcast <dot> net
 
Tnak you very much

--
Frane Roje

Have a nice day

Remove (d*el*ete) from email to reply
 
Frane said:
I'm trying to connect to a server using non-blocking sockets with the
method Socket.BeginConnect().

Just a note. Non-blocking sockets are different from async I/O.
BeginConnect() is async I/O.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top