i try to understand how to use setsocketfactory but it is not clear. I dont find sample with this kind of cases and the help file does not help
let say, the current server has 2 network cards : one with ip 192.168.1.2 and one with 192.168.10.2
using standard tcpip instruction , windows will use the defaut 192.168.1.2
but if I want to connect via the second network card, I need to do something like :
ip = "192.168.10.2";
iMail_ServerPort = 25;
RemoteEndPoint = new IPEndPoint(m_ip, iMail_ServerPort);
ipadr = IPAddress.Parse(ip);
localEndPoint = new IPEndPoint(ipadr, 0);
socket.Bind(localEndPoint);
socket.Connect(RemoteEndPoint);
what make complex is that setsocketfactory does not use sockets but a custom class isockets
can you provide a sample ?
PS : this can also be necessary when using other component than smtp
answered 8/8/2019 10:52:45 PM