Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.netty.channel.Channel; | |
import io.netty.channel.ChannelHandlerContext; | |
import io.netty.channel.SimpleChannelInboundHandler; | |
import io.netty.channel.group.ChannelGroup; | |
import io.netty.channel.group.DefaultChannelGroup; | |
import io.netty.handler.ssl.SslHandler; | |
import io.netty.util.concurrent.Future; | |
import io.netty.util.concurrent.GenericFutureListener; | |
import io.netty.util.concurrent.GlobalEventExecutor; | |
import java.net.InetAddress; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.netty.bootstrap.Bootstrap; | |
import io.netty.channel.Channel; | |
import io.netty.channel.ChannelFuture; | |
import io.netty.channel.ChannelFutureListener; | |
import io.netty.channel.EventLoopGroup; | |
import io.netty.channel.nio.NioEventLoopGroup; | |
import io.netty.channel.socket.nio.NioSocketChannel; | |
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.netty.bootstrap.Bootstrap; | |
import io.netty.channel.Channel; | |
import io.netty.channel.ChannelFuture; | |
import io.netty.channel.ChannelFutureListener; | |
import io.netty.channel.EventLoopGroup; | |
import io.netty.channel.nio.NioEventLoopGroup; | |
import io.netty.channel.socket.nio.NioSocketChannel; | |
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.netty.bootstrap.ServerBootstrap; | |
import io.netty.channel.ChannelFuture; | |
import io.netty.channel.EventLoopGroup; | |
import io.netty.channel.nio.NioEventLoopGroup; | |
import io.netty.channel.socket.nio.NioServerSocketChannel; | |
public class ChatServer { | |
private final int port; | |
public ChatServer(int port) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void pingHost1() throws IOException, InterruptedException{ | |
String strCommand = "ping "+hostip; | |
Process myProcess = Runtime.getRuntime().exec(strCommand); | |
myProcess.waitFor(); | |
if(myProcess.exitValue() == 0) { | |
System.out.println("= ping success ="); | |
} else { | |
System.out.println("= ping failure ="); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//************************************************************************ | |
//Author: Gaurav Bhardwaj | |
//Linked list implementation of stack | |
//************************************************************************ | |
#include <iostream> | |
using namespace std; | |
class Stack{ | |
private: | |
struct Stackelement | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//*********************************************** | |
// author: Gaurav Bhardwaj | |
// Static array implementation of stack | |
//*********************************************** | |
#include <iostream> | |
using namespace std; | |
class Stack | |
{ | |
private: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*********************************************************************** | |
//Program to find the maximum element in an list using recursion | |
*********************************************************************** | |
#include <iostream> | |
using namespace std; | |
int largest(int list[],int lowerIndex,int UpperIndex) | |
{ | |
if(lowerIndex==UpperIndex)//base case | |
return lowerIndex; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//***************************************************** | |
//Author: Gaurav Bhardwaj | |
//Linked list implementation of Queue | |
//***************************************************** | |
#include <iostream> | |
using namespace std; | |
class Queue | |
{ |
NewerOlder