All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jgroups.tests.bla2 Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.jgroups.tests;

import org.jgroups.util.Util;

import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author Bela Ban
 * @since x.y
 */
public class bla2  {
    protected ServerSocket srv_sock;
    protected int count=1;

    protected void start() throws Exception {
        srv_sock=new ServerSocket(7900);
        for(;;) {
            Socket client_sock=null;
            try {
                client_sock=srv_sock.accept();
                client_sock.getOutputStream().write(("hello " + count++ + "\n").getBytes());
            }
            finally {
                Util.close(client_sock);
            }
        }
    }

    public static void main(String[] args) throws Exception {
        new bla2().start();
    }



}







© 2015 - 2025 Weber Informatics LLC | Privacy Policy