コード例 #1
0
        private void OnSocketError(string message, SocketError se)
        {
            BitSwarmEvent bitSwarmEvent = new BitSwarmEvent(BitSwarmEvent.IO_ERROR);

            bitSwarmEvent.Params            = new Hashtable();
            bitSwarmEvent.Params["message"] = message + " ==> " + se;
            DispatchEvent(bitSwarmEvent);
        }
コード例 #2
0
        private void OnBBConnect(BaseEvent e)
        {
            bbConnected = true;
            BitSwarmEvent bitSwarmEvent = new BitSwarmEvent(BitSwarmEvent.CONNECT);

            bitSwarmEvent.Params                   = new Hashtable();
            bitSwarmEvent.Params["success"]        = true;
            bitSwarmEvent.Params["isReconnection"] = false;
            DispatchEvent(bitSwarmEvent);
        }
コード例 #3
0
        private void OnSocketConnect()
        {
            BitSwarmEvent bitSwarmEvent = new BitSwarmEvent(BitSwarmEvent.CONNECT);
            Hashtable     hashtable     = new Hashtable();

            hashtable["success"]        = true;
            hashtable["isReconnection"] = attemptingReconnection;
            bitSwarmEvent.Params        = hashtable;
            DispatchEvent(bitSwarmEvent);
        }
コード例 #4
0
        private void OnBBError(BaseEvent e)
        {
            BBEvent bBEvent = e as BBEvent;

            log.Error("## BlueBox Error: " + (string)bBEvent.Params["message"]);
            BitSwarmEvent bitSwarmEvent = new BitSwarmEvent(BitSwarmEvent.IO_ERROR);

            bitSwarmEvent.Params            = new Hashtable();
            bitSwarmEvent.Params["message"] = bBEvent.Params["message"];
            DispatchEvent(bitSwarmEvent);
        }
コード例 #5
0
        private void OnSocketError(string message, SocketError se)
        {
            manualDisconnection = false;
            if (attemptingReconnection)
            {
                Reconnect();
                return;
            }
            BitSwarmEvent bitSwarmEvent = new BitSwarmEvent(BitSwarmEvent.IO_ERROR);

            bitSwarmEvent.Params            = new Hashtable();
            bitSwarmEvent.Params["message"] = message + " ==> " + se;
            DispatchEvent(bitSwarmEvent);
        }
コード例 #6
0
 private void OnSocketData(byte[] data)
 {
     try
     {
         ByteArray buffer = new ByteArray(data);
         ioHandler.OnDataRead(buffer);
     }
     catch (Exception ex)
     {
         log.Error("## SocketDataError: " + ex.Message);
         BitSwarmEvent bitSwarmEvent = new BitSwarmEvent(BitSwarmEvent.DATA_ERROR);
         Hashtable     hashtable     = new Hashtable();
         hashtable["message"] = ex.ToString();
         bitSwarmEvent.Params = hashtable;
         DispatchEvent(bitSwarmEvent);
     }
 }
コード例 #7
0
 private void DispatchEvent(BitSwarmEvent evt)
 {
     dispatcher.DispatchEvent(evt);
 }