CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2000
    Posts
    1

    Socket write Error HELP

    The applet is a gif loader (from an servlet on a secured server) that let you paint over the loaded gif and the save it back on the secured server (the servlet do the job fine). Now I just have to send the encoded gif in the stream (by the http).

    My problem is to send the aray of byte encode as a gif by my applet and send it to the servlet...
    here is the code that i use:

    //---------------------------
    GifImageEncoder objGifEncoder = new GifImageEncoder(objImageToSave);
    objGifEncoder.indexColors();
    URL tmpURL = new URL("132.203.52.203/graph/graph.DRIOQ_Graph");
    HttpURLConnection objConnection = new HttpImpl(tmpURL);
    objConnection.setDoInput(false);
    objConnection.setDoOutput(true);
    OutputStream out = objConnection.getOutputStream();
    objConnection.connect();
    objGifEncoder.encodeTo(out); //HERE IS THE socket write Error !!!
    out.flush();
    out.close();
    //---------------------------



    There is an socket write error when i run it...
    Please HELP !
    here is my E-mail [email protected]



  2. #2
    Join Date
    Dec 1999
    Location
    Chonghe, Taipei County, Taiwan, R.O.C.
    Posts
    231

    Re: Socket write Error HELP

    I suspect if it the connection is not established while you use the code, new HttpImpl(tmpURL).
    I don't know what it does so I can not give you any comment. But you may use
    URL.openConnection to get the instance of URLConnection for the connection.
    good luck
    Alfred Wu


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured