Hi, I am new to J2ME and I am developing an application that implements a simple SMTP client using the socket protocol to send an e-mail. Here the code to create the connection:
StreamConnection socket = (StreamConnection)Connector.open("socket://smtpserver:25", Connector.READ_WRITE, true);
InputStream input = socket.openInputStream();
OutputStream output = socket.openOutputStream();
The InputStream.read(byte, int, int) method is used to read data and the OutputStream.write(byte, int, int) to send data.
When I run the app on the emulator, all works fine. Welcome mgs received from the server, HELO cmd sended and the response correctly received, ecc...
When the app runs on a Nokia 3650 device, it correctly receives data from the server (ie. the welcome msg) but when it sends the HELO cmd, no response was received and, after some minutes, the device receives the error msg "451 Timeout waiting for client input"
What could be the reason for this strange behaviour? How can I solve this problem?