1132 Networking: Streams-Based Sockets and Datagrams Chapter 22 (Web hosting unlimited bandwidth)
1132 Networking: Streams-Based Sockets and Datagrams Chapter 22 board, if the specified mark location is valid (e.g., that location does not already contain a mark). Note that the whilestructure continues execution only if boolvariable doneis false. This variable is set to true by event handler Server_Closing of class Server, which is invoked when the server closes the connection. 1 // Fig. 22.6: Client.cs 2 // Client for the TicTacToe program. 3 4 using System; 5 using System.Drawing; 6 using System.Collections; 7 using System.ComponentModel; 8 using System.Windows.Forms; 9 using System.Data; 10 using System.Net.Sockets; 11 using System.Threading; 12 using System.IO; 13 14 // represents a tic-tac-toe player 15 public class Client : System.Windows.Forms.Form 16 { 17 private System.Windows.Forms.Label idLabel; 18 19 private System.Windows.Forms.TextBox displayTextBox; 20 21 private System.Windows.Forms.Panel panel1; 22 private System.Windows.Forms.Panel panel2; 23 private System.Windows.Forms.Panel panel3; 24 private System.Windows.Forms.Panel panel5; 25 private System.Windows.Forms.Panel panel6; 26 private System.Windows.Forms.Panel panel4; 27 private System.Windows.Forms.Panel panel7; 28 private System.Windows.Forms.Panel panel8; 29 private System.Windows.Forms.Panel panel9; 30 31 private Square[ , ] board; 32 private Square currentSquare; 33 34 private Thread outputThread; 35 36 private TcpClient connection; 37 private NetworkStream stream; 38 private BinaryWriter writer; 39 private BinaryReader reader; 40 41 private char myMark; 42 private bool myTurn; 43 44 private SolidBrush brush; 45 private System.ComponentModel.Container components = null; 46 47 bool done = false; Fig. 22.6 Fig. 22.FiFig. 22.6g. 22.6Client side of client/server Tic-Tac-Toe program. (Part 1 of 7.) Fig. 22.6
Note: In case you are looking for affordable and reliable webhost to host and run your business application check Vision ftp web hosting services