コード例 #1
0
 private void Start()
 {
     //開始連線,設定使用網路、串流、TCP
     //Debug.Log("Hello world!");
     inputBuffer = new List <string> ();
     st          = new ServerThread(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp, "0.0.0.0", 8000);
     st.Listen();        //讓Server socket開始監聽連線
     st.StartConnect();  //開啟Server socket
 }
コード例 #2
0
    private void Start()
    {
        ss.a = 1;
        ss.b = 2;

        //開始連線,設定使用網路、串流、TCP
        // st = new ServerThread(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp, "127.0.0.1", 8000);
        st = new ServerThread(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp, PlayerParam.ipAddress, 8000);
        st.Listen();       //讓Server socket開始監聽連線
        st.StartConnect(); //開啟Server socket
        isSend = true;
    }