Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- BufferUI window = new BufferUI();
- window.frame.setVisible(true);
- }
- private static final int PORT = 65000; // random large port number
- private static ServerSocket s;
- // static initializer
- static {
- try {
- s = new ServerSocket(PORT, 10, InetAddress.getLocalHost());
- } catch (UnknownHostException e) {
- // shouldn't happen for localhost
- } catch (IOException e) {
- // port taken, so app is already running
- System.exit(0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement