FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Bugs
   Software Bugs
(Moderator: fry)
   endNet() not responding
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: endNet() not responding  (Read 382 times)
senior

89237688923768 WWW
endNet() not responding
« on: Aug 27th, 2003, 4:54pm »

I don't think endNet() is working properly -- any code after calling it doesn't seem to respond. ie:
 
Code:
int port = 5204;
String ip = "localhost";
BFont metaBold;
String output = "Waiting to connect...";
boolean connected = false;
 
void setup()
{
  size(400,200);
  background(200,200,200);
 
  metaBold = loadFont("Meta-Bold.vlw.gz");
  setFont(metaBold,44);
  hint(SMOOTH_IMAGES);
}
 
public void netEvent()
{
  if (net != null) {
    output = net;
  }
  System.out.println("net event received");
}
 
void loop() {
  text(output, 10, 30);
}
 
public void mousePressed()
{
  //toggle the connection
  if(connected) {
    endNet();
    output = "Waiting to connect...";
    connected = false;
  }
  else {
    beginNet(ip, port);
    output = "Connected.";
    connected = true;
  }
}
 
public void stop() {
  endNet();
}

 
When I disconnect from the server, the code after endNet() does not get executed... the app seems to hang. Same with when I do endNet() in the stop() method; the app doesn't disconnect properly. Does endNet() normally print out a message saying that is has disconnected?
 
Also, if I put this in the Value Client example:
Code:
public void mouseClicked() {
  endNet();
}

it causes a "read error from network server" error.
 
Cheers,
-robin
 
Pages: 1 

« Previous topic | Next topic »