×

Discussion Board

Results 1 to 1 of 1
  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    5

    error sending data to the server. SymbianOS error -1

    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:
    General:
    System error
    =====================

    my code to connect is as follows:
    Code:
    <snip>
            HttpConnection conn = null;
    
            try
            {
                progDisplay("Connecting to the server..." );
                conn = (HttpConnection)Connector.open( url );
                sendData(conn, data);
            }
             catch( IOException e )
            {
                progDisplay("Error connecting to the server:" + "\n" + e.getMessage());
            }
    
    <snip>
    
    
        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 );
            os.close();
        }
    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 );

    Why would there be a problem closing the stream??

    Any help would be much appreciated.
    Last edited by dihex; 2005-11-15 at 18:58. Reason: change title

Similar Threads

  1. suckho, i have encontered the same problems. Could you tell me how you resolved it?
    By dicson_hu in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2005-12-09, 10:56
  2. GPRS connection problems on 6600..
    By suckho in forum Symbian Networking & Messaging (Closed)
    Replies: 10
    Last Post: 2005-12-02, 14:00
  3. 6600 gprs 发送大量rtp延时问题
    By dicson_hu in forum Symbian
    Replies: 9
    Last Post: 2005-11-04, 02:12
  4. Nokia 6600 Socket Server send delay Problem
    By dicson_hu in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-10-31, 07:37
  5. Cannot to receive data from server...
    By ramis55 in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2005-05-09, 13:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •