Exemple #1
0
        public static MyLogger getInstance()
        {
            if (myLoggerClsSingl == null)
                myLoggerClsSingl = new MyLogger();

            return myLoggerClsSingl;
        }
Exemple #2
0
        /**
         *  @brief      Form1_Load
         *  @param[in]  object      sender
         *  @param[in]  EventArgs   e
         *  @return     void
         *  @note       TcpServer起動
         */
        private void Form1_Load(object sender, EventArgs e)
        {
            // MyLoggerクラスに textBox1設定
            mylogger = MyLogger.getInstance();
            mylogger.setMyLoggerObject(this);

            srv = new MyTcpServer();
            srv.startProc("127.0.0.1", 7777, 8);
            //srv.startProc("192.168.20.1", 7777, 8);
        }
 /**
  *  @brief      setTcpClient
  *  @param[in]  TcpClient   接続してきた Clientの TcpClientクラスObject
  *  @return     void
  */
 public void setTcpClient(TcpClient client)
 {
     myClient = client;
     //client.Client.Handle.ToInt32();
     mylogger = MyLogger.getInstance();
     //System.Net.ServicePointManager.SetTcpKeepAlive(true, 1000, 5);
     //myClient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, 1000);
     //System.Net.ServicePointManager.SetTcpKeepAlive(true, 1000, 5);
 }