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

io.baltoro.client.BaltoroWSPing100 Maven / Gradle / Ivy

There is a newer version: 4.0.12
Show newest version
package io.baltoro.client;

import java.nio.ByteBuffer;

import javax.websocket.Session;

public class BaltoroWSPing100 extends Thread
{

	Session session;
	int count=0;
	Baltoro baltoro;
	
	public BaltoroWSPing100(Baltoro baltoro, Session session)
	{
		this.baltoro = baltoro;
		this.session = session;
	}
	
	public void run()
	{
		
		while(true)
		{
			count++;
			try
			{
					
				ByteBuffer  msg = ByteBuffer.wrap((" ** 100 * "+count).getBytes());
				session.getBasicRemote().sendPing(msg);
				
				System.out.println("sending ping "+count);
				Thread.sleep(5000);
			} 
			catch (Exception e)
			{
				e.printStackTrace();
				break;
			}
		}
	
	}
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy