socket connection in a .NET Applet (Windowsformcontrol hosted on browser)
Hi, I have created a .Net Applet that connects to an FTP server via sockets. The problem is that the connection to the socket takes a long time (at around 100+ seconds). I tried creating an implementation of the FTP class in a Windows Form and I got connected faster (roughly 1-3 seconds).
Are there issues when connecting/opening sockets in .Net Applet?
sample code
public Boolean Login()
{
// Create socket
m_objClientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
// Create IPEndpoint
IPEndPoint ep = new IPEndPoint(Dns.Resolve(m_sRemoteHost).AddressList[0], m_iRemotePort);
try
{
// Connect Socket takes a long time in applet
m_objClientSocket.Connect(ep);
}
catch(Exception ex)
{
MessageString = m_sReply;
throw new IOException("Cannot connect to the remote server. Error: " + ex.Message);
}
.......