Socket cli;

while(true){

    // 接收到的資料

    byte [] b = new byte[1024];

    int i = cli.Receive(b, 0, b.Length, SocketFlags.None);

 

    // 傳送的資料

    byte[] msg = Encoding.ASCII.GetBytes("ABCD");

    int bytesSend = cli.Send(msg, 0, msg.Length, SocketFlags.None);

}

arrow
arrow
    全站熱搜

    黃彥霖 發表在 痞客邦 留言(0) 人氣()