|  | 
 
  
    | 
      
        |  Author | Topic: Network Error  (Read 399 times) |  |  
  
    | 
      
        | 
          
            | skloopy 
 
   
 | 
              
                | Network Error «  on: Jun 8th, 2003, 5:58am »
 |  |  When running a network server on OSX, if you close the sketch and then try to run it again it gives a network error and closes the server. Since there is no way to know when the user closes the sketch, is there a way to close the connection so that P5 can run a net sketch more than once?
 
 on a side note, is it possible to netWrite just before a user closes an applet? It would be useful because otherwise how does the server know the user logged off?
 
 also, I don't think that netEvent() works in server mode, which is pretty essential.
 |  
            | 
              
                | « Last Edit: Jun 8th, 2003, 6:48am by skloopy » |  |  |  |  |  
  
    | 
      
        | 
          
            | fry 
 
 
   
 | 
              
                | Re: Network Error « Reply #1 on: Jun 8th, 2003, 5:32pm »
 |  |  all noted. will look into 'em. the first two are common problems that we've already worked around for serial so it shouldn't be a big deal for net. the last one just sounds like a random bug.
 |  
            |  |  |  |  
  
    | 
      
        | 
          
            | fry 
 
 
   
 | 
              
                | Re: Network Error « Reply #2 on: Jul 31st, 2003, 4:02am »
 |  |  ok, i think hernando and i have ironed these out for 57.
 |  
            |  |  |  |  
  
    | 
      
        | 
          
            | masarius 
 
 
 | 
              
                | Re: Network Error « Reply #3 on: Aug 7th, 2003, 3:06am »
 |  |  I think I was having a similar problem trying to implement some network stuff.  Firstly I found that if I closed my server application (run from within the sketchbook) before calling endNet() then I wouldn't be able to start a server using the same instance of processing again, but if I called endNet() this was not an issue.
 
 In response to calling code when the user closes the applet, I found that you can override the stop() method (which is inherited from the Applet class) like so:
 
 public void stop(){
 // Code to be executed on exit goes here
 }
 
 the public is important otherwise you get an error about overriding with a more restrictive method.  Hope this is some help to somebody.
 |  
            |  |  |  |  
  
    | 
      
        | 
          
            | REAS 
 
   
 | 
              
                | Re: Network Error « Reply #4 on: Aug 7th, 2003, 3:14am »
 |  |  this should be fixed in version 58 which was released yesterday. let us know if you're still having the same problem with this new release.
 |  
            |  |  |  |  
  
    | 
      
        | 
          
            | senior 
 
      
 | 
              
                | Re: Network Error « Reply #5 on: Aug 21st, 2003, 11:19pm »
 |  |  If I have a have a client app that doesn't call endNet() before closing, it hangs processing, and I have to kill javaw.exe from the process list.
 
 I tried putting endNet() in public void stop() as suggested, but it still hangs.
 
 [using v.58 on WinXP java1.4.1]
 |  
            |  |  |  |  
  
    | 
      
        | 
          
            | madmerv Guest
 
  
 | 
              
                | Re: Network Error « Reply #6 on: Nov 14th, 2003, 11:06pm »
 |  |  that's a good question...!
 |  
            |  |  |  |  
  
    | 
      
        | 
          
            | fry 
 
 
   
 | 
              
                | Re: Network Error « Reply #7 on: Nov 23rd, 2003, 11:46pm »
 |  |  yup, net is having a lotta trouble. i hope to get it repaired soon, or maybe its author (hernando) will have some time to look into it.
 |  
            |  |  |  |  
 |