I am trying to open port 25 on Android but for some reason I keep getting the following error
java.net.BindException: bind failed: EACCES (Permission denied)
Below is the code that I am using
ServerSocket ss = new ServerSocket(smtpPort);
Log.d("SMTPSocketHandler", "Socket created");
while (!end)
{
Socket s = ss.accept();
Log.d("SMTPSocketHandler", "Client Accepted");
BufferedReader input = new BufferedReader(new InputStreamReader(s.getInputStream()));
PrintWriter output = new PrintWriter(s.getOutputStream());
String stringData = input.readLine();
output.println("FROM Server - " + stringData.toUpperCase());
output.flush();
end = true;
output.close();
s.close();
break;
}
ss.close();
If I use another port though such as 5555 it then works. Is there a particular reason this isn't supported or is there something I can do to make it work?