I have an application that sends data to a servlet. It has been working fine on the WTK emulator.
When I run it on a nokia 6630 (this is the only phone i have tried it on) I get the following error:
Error connecting to the server:
SymbianOS error = -1:
my code to connect is as follows:
I got it to output progress information when in the sendData() method and it stopped between os.write( data ); and os.close(); By that i mean i got it to print out a message after every step in that method, the last message that got printed was just after os.write( data );
HttpConnection conn = null;
progDisplay("Connecting to the server..." );
conn = (HttpConnection)Connector.open( url );
catch( IOException e )
progDisplay("Error connecting to the server:" + "\n" + e.getMessage());
private void sendData(HttpConnection conn, byte data) throws IOException
conn.setRequestMethod( HttpConnection.POST );
conn.setRequestProperty("Content-Language", "en-US" );
conn.setRequestProperty("Accept", "application/octet-stream" );
conn.setRequestProperty("Connection", "close" );
conn.setRequestProperty("Content-Length", Integer.toString( data.length ) );
OutputStream os = conn.openOutputStream();
os.write( data );
Why would there be a problem closing the stream??
Any help would be much appreciated.