Connect() 공개 메소드

Connects the client to the server
public Connect ( ) : bool
리턴 bool
예제 #1
0
        public Form1()
        {
            InitializeComponent();
            _client = new Networking.Client("127.0.0.1", 10250);
            _client.Connect();

            FormClosing += Form1_FormClosing;
        }
예제 #2
0
 private void btnReconnect_Click(object sender, EventArgs e)
 {
     _client = new Client("127.0.0.1", 10250);
     if(_client.Connect()) {
         MessageBox.Show("Connected");
     } else {
         MessageBox.Show("Failed");
     }
 }
예제 #3
0
 public FormMain()
 {
     InitializeComponent();
     _client = new Client("127.0.0.1", 10250);
     if (!_client.Connect()) {
         _client = null;
         return;
     }
     _client.Disconnected += Client_Disconnected;
     _client.MessageReceived += Client_MessageReceived;
     FormClosing += FormMain_FormClosing;
 }