Ejemplo n.º 1
0
    // Use this for initialization
    void Awake()
    {
        callback.callback += GetClientMessage;
        SocketProcessData process = new SocketProcessData(callback);

        _dispatcher       = new SocketEventDispatcher(process);
        _packetProcesser  = new PacketProcesser();
        RecvEventHandler += new EventHandler <RecvEvent>(this.OnRecveHandler);
    }
Ejemplo n.º 2
0
    public void InitClient()
    {
        _packetProcesser = new PacketProcesser();

        SocketCallBack callback = new SocketCallBack();

        callback.callback += GetServerMessage;
        SocketProcessData process = new SocketProcessData(callback);

        _dispatcher = new SocketEventDispatcher(process);


        _client = new SocketClient();
        _client.RecvEventHandler    += new EventHandler <RecvEvent>(this.OnRecveHandler);
        _client.ConnectHandler      += new EventHandler <ConnectEvent>(this.OnConnectHandler);
        _client.CloseHandler        += new EventHandler(this.OnCloseHandler);
        _client.ConnectErrorHandler += new EventHandler(this.OnConnectErrorHandler);
        _client.ReconnectHandler    += new EventHandler(this.OnReconnectHandler);
    }
Ejemplo n.º 3
0
 public MapleClient(TcpClient client, PacketProcesser processer) : base(client)
 {
     _processer    = processer;
     Disposing    += MyOnDisposing;
     DataReceived += MyOnDataReceived;
 }