Fixes for the now gone local UDP port.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7087 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
PSp..om 14 years ago
parent 862d2729f8
commit c552080030
  1. 2
      engine/src/test/jme3test/network/TestChatClient.java
  2. 2
      engine/src/test/jme3test/network/TestChatServer.java
  3. 8
      engine/src/test/jme3test/network/TestThroughput.java

@ -98,7 +98,7 @@ public class TestChatClient extends JFrame
getContentPane().add( p, "South" ); getContentPane().add( p, "South" );
client = Network.connectToServer( TestChatServer.NAME, TestChatServer.VERSION, client = Network.connectToServer( TestChatServer.NAME, TestChatServer.VERSION,
host, TestChatServer.PORT, TestChatServer.PORT + 1 ); host, TestChatServer.PORT );
client.addMessageListener( new ChatHandler(), ChatMessage.class ); client.addMessageListener( new ChatHandler(), ChatMessage.class );
client.start(); client.start();
} }

@ -96,7 +96,7 @@ public class TestChatServer
// a good example of session data // a good example of session data
source.setAttribute( "name", ((ChatMessage)m).getName() ); source.setAttribute( "name", ((ChatMessage)m).getName() );
System.out.println( "Broadcasting:" + m ); System.out.println( "Broadcasting:" + m + " reliable:" + m.isReliable() );
// Just rebroadcast... the reliable flag will stay the // Just rebroadcast... the reliable flag will stay the
// same so if it came in on UDP it will go out on that too // same so if it came in on UDP it will go out on that too

@ -50,7 +50,7 @@ public class TestThroughput implements MessageListener<MessageConnection> { //ex
private static Client client; private static Client client;
// Change this flag to test UDP instead of TCP // Change this flag to test UDP instead of TCP
private static boolean testReliable = true; private static boolean testReliable = false;
private boolean isOnServer; private boolean isOnServer;
@ -94,10 +94,12 @@ public class TestThroughput implements MessageListener<MessageConnection> { //ex
Serializer.registerClass(TestMessage.class); Serializer.registerClass(TestMessage.class);
Server server = Network.createServer( 5110 ); // Use this to test the client/server name version check
//Server server = Network.createServer( "bad name", 42, 5110, 5110 );
Server server = Network.createServer( 5110, 5110 );
server.start(); server.start();
Client client = Network.connectToServer( "localhost", 5110, 5000 ); Client client = Network.connectToServer( "localhost", 5110 );
client.start(); client.start();
client.addMessageListener(new TestThroughput(false), TestMessage.class); client.addMessageListener(new TestThroughput(false), TestMessage.class);

Loading…
Cancel
Save