Home > Java > Search Results For: video streaming with java

Search Results For: video streaming with java

March 24, 2011

public class TimeClient
{
public static void main(String[] args) throws Exception
{
String host = “127.0.0.1”;
int port = 80;

ChannelFactory factory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),Executors.newCachedThreadPool());
ClientBootstrap bootstrap = new ClientBootstrap(factory);
bootstrap.setPipelineFactory(new ChannelPipelineFactory()
{
public ChannelPipeline getPipeline()
{
return Channels.pipeline(new TimeEncoder(),new TimeClientHandler());
}
});
bootstrap.setOption(“tcpNoDelay”, true);
bootstrap.setOption(“keepAlive”, true);
bootstrap.connect(new InetSocketAddress(host, port));
}
}

Advertisements
Categories: Java
%d bloggers like this: