Dear experts,
i have strange problem atleast for me :
private void makeContact()throws IOException, InterruptedException
/* Contact the server, and set up a TourWatcher to monitor the
server. */
{
try {
TP.start();
}
catch(Exception e)
{ System.out.println("No contact with server"+e);
System.exit(0);
}
} // end of makeContact()
here it’s not working when i m sending message from here, channel is null:
sceneBG.addChild( new CheckerFloor().getBG() ); // add the floor
makeScenery(tourFnm); // add scenery and obstacles
TP = new TourProxy("localhost",this,obs);
makeContact(); // contact server (after Obstacles object created)
***TP.sendMessage("create " + userName + " " + xPosn + " " + zPosn);*** //not working
addTourist(userName, xPosn, zPosn);
sceneBG.compile(); // fix the scene
} // end of createSceneGraph()
here from this class constrcutor it is working:
public TourSprite(String userName, String fnm, Obstacles obs,
double xPosn, double zPosn, TourProxy tp) throws IOException
{ super(userName, fnm, obs);
setPosition(xPosn, zPosn);
// out = o;
this.tp1 = tp;
***tp1.sendMessage("create " + userName + " " + xPosn + " " + zPosn);***//working from here
// out.println("create " + userName + " " + xPosn + " " + zPosn);
} // end of TourSprite()
when i m calling message as i shown from then “channel” in my TourProxy class is “NULL” and the message is not going to server
but when i m passing this TP to the class TourSprite which i don’t need but i m using that just for this purpose the send message is working and there is no problem the channel is NOT null, why it is like that and what is the solution.
PS:i feel that this problem is because of some thread suspension while 3d GUI rendering is also happening and networking stuff is also going on…
Code Reference: The killer game programming, Chapter 32. Networked Tour3D here:http://fivedots.coe.psu.ac.th/~ad/jg/ch21/index.html.
thanks in advance for any reviews
jibbylala
its cross link : http://www.java-gaming.org/index.php/topic,23495.0.html considering the problem particularly related to Rendering with java3d.