gxmail/src/main/java/com/genexus/internet/POP3Session.java
/**
	 * Open a TCP socket to the server.
	 */
Open a TCP socket to the server.
Open a TCP socket to the server .
private void connect(final int type) throws GXMailException
	{
	  	try
	  	{ 
	  		SpecificImplementation.NativeFunctions.getInstance().executeWithPermissions(
					new Runnable() {
						public void run()
						{
							try
							{
		  						socket = getConnectionSocket(type);
							}
							catch (IOException e)
							{
							}
						}
					}, INativeFunctions.CONNECT);
			if	(socket == null)
				throw new GXMailException("Can't connect to mail server", MAIL_CantLogin);
			socket.setSoTimeout(timeout * 1000);
			socket.setTcpNoDelay(true);
			InputStream sin = socket.getInputStream();
			in  = new BufferedReader(new InputStreamReader(sin));
			out = new PrintWriter(socket.getOutputStream());
			doCommand(null);					
		}
	  	catch(SocketException e)
	  	{
			throw new GXMailException("Error opening the socket connection. " + e.getMessage(), MAIL_CantLogin);
	  	} 
		catch(UnknownHostException e)
		{
			throw new GXMailException("Error while opening socket: Host Unknown: " + pop3Host + " " +e.getMessage(), MAIL_CantLogin);
		}
		catch(IOException e)
		{
			throw new GXMailException("Error while trying to read or write. " + e.getMessage(), MAIL_CantLogin);
		}
	}
private void connect ( final int type ) throws GXMailException { try { SpecificImplementation . NativeFunctions . getInstance ( ) . executeWithPermissions ( new Runnable ( ) { public void run ( ) { try { socket = getConnectionSocket ( type ) ; } catch ( IOException e ) { } } } , INativeFunctions . CONNECT ) ; if ( socket == null ) throw new GXMailException ( "Can't connect to mail server" , MAIL_CantLogin ) ; socket . setSoTimeout ( timeout * 1000 ) ; socket . setTcpNoDelay ( true ) ; InputStream sin = socket . getInputStream ( ) ; in = new BufferedReader ( new InputStreamReader ( sin ) ) ; out = new PrintWriter ( socket . getOutputStream ( ) ) ; doCommand ( null ) ; } catch ( SocketException e ) { throw new GXMailException ( "Error opening the socket connection. " + e . getMessage ( ) , MAIL_CantLogin ) ; } catch ( UnknownHostException e ) { throw new GXMailException ( "Error while opening socket: Host Unknown: " + pop3Host + " " + e . getMessage ( ) , MAIL_CantLogin ) ; } catch ( IOException e ) { throw new GXMailException ( "Error while trying to read or write. " + e . getMessage ( ) , MAIL_CantLogin ) ; } }
Open a TCP socket to the server.
Open a TCP socket to the server .