示例#1
0
 private void Playgame_Load(object sender, EventArgs e)
 {
     client = new NetComm.Client(); //Initialize the client object
     //Adding event handling methods for the client
     client.Connected    += new NetComm.Client.ConnectedEventHandler(client_Connected);
     client.Disconnected += new NetComm.Client.DisconnectedEventHandler(client_Disconnected);
     client.DataReceived += new NetComm.Client.DataReceivedEventHandler(client_DataReceived);
     client.Connect(strIPAddress, numPortData, nameClient); //Connecting to the host (on the same machine) with port 5000 and ID is variable name in contrustor function
 }
示例#2
0
        NetComm.Client client; //The client object used for the communication
        private void MainDisplay_Load(object sender, EventArgs e)
        {
            client = new NetComm.Client(); //Initialize the client object

            //Adding event handling methods for the client
            client.Connected    += new NetComm.Client.ConnectedEventHandler(client_Connected);
            client.Disconnected += new NetComm.Client.DisconnectedEventHandler(client_Disconnected);
            client.DataReceived += new NetComm.Client.DataReceivedEventHandler(client_DataReceived);

            //Connecting to the host
            client.Connect("localhost", 2020, "Jack"); //Connecting to the host (on the same machine) with port 2020 and ID "Jack"
        }
示例#3
0
 public Form1(NetComm.Client client)
 {
     _client = client;
     InitializeComponent();
 }