1: // Fig. 24.20: SocketMessengerConstants.java 2: // SocketMessengerConstants defines constants for the port numbers 3: // and multicast address in DeitelMessenger 4: package com.deitel.messenger.sockets; 5: 6: public interface SocketMessengerConstants 7: { 8: // address for multicast datagrams 9: public static final String MULTICAST_ADDRESS = "239.0.0.1"; 10: 11: // port for listening for multicast datagrams 12: public static final int MULTICAST_LISTENING_PORT = 5555; 13: 14: // port for sending multicast datagrams 15: public static final int MULTICAST_SENDING_PORT = 5554; 16: 17: // port for Socket connections to DeitelMessengerServer 18: public static final int SERVER_PORT = 12345; 19: 20: // String that indicates disconnect 21: public static final String DISCONNECT_STRING = "DISCONNECT"; 22: 23: // String that separates the user name from the message body 24: public static final String MESSAGE_SEPARATOR = ">>>"; 25: 26: // message size (in bytes) 27: public static final int MESSAGE_SIZE = 512; 28: } // end interface SocketMessengerConstants 29: 30: 31: /************************************************************************** 32: * (C) Copyright 1992-2005 by Deitel & Associates, Inc. and * 33: * Pearson Education, Inc. All Rights Reserved. * 34: * * 35: * DISCLAIMER: The authors and publisher of this book have used their * 36: * best efforts in preparing the book. These efforts include the * 37: * development, research, and testing of the theories and programs * 38: * to determine their effectiveness. The authors and publisher make * 39: * no warranty of any kind, expressed or implied, with regard to these * 40: * programs or to the documentation contained in these books. The authors * 41: * and publisher shall not be liable in any event for incidental or * 42: * consequential damages in connection with, or arising out of, the * 43: * furnishing, performance, or use of these programs. * 44: *************************************************************************/ 45: