public static bool Connected(OthelloTCPClient client) { throw new NotImplementedException("[Connected] : Toolbox"); //bool part1 = client.Socket.Poll(1000, System.Net.Sockets.SelectMode.SelectRead); //bool part2 = client.Socket.Available == 0; //return !(part1 & part2); }
public void Connect(GameType localOrOnline) { // Init a new client client = new OthelloTCPClient(); // Attach the client OrderHandler to this client.SetOrderHandler(this); // Connect the client to the target gametype server if (localOrOnline == GameType.Local) { IsLocalPlayer = true; client.ConnectTo(Properties.Settings.Default.LocalHostname, Properties.Settings.Default.LocalPort); } else { IsLocalPlayer = false; client.ConnectTo(Properties.Settings.Default.OnlineHostname, Properties.Settings.Default.OnlinePort); } }
/// <summary> /// Constructor /// </summary> /// <param name="tcpClient">socket</param> public OthelloPlayerServer(OthelloTCPClient tcpClient) { client = tcpClient; client.SetOrderHandler(this); }