Пример #1
0
 public static void start(string ip)
 {
     client = new SimpleTCP.SimpleTcpClient();
     client.StringEncoder = Encoding.UTF8;
     client.DataReceived += clientData;
     client.Connect(ip, 10757);
     client.WriteLineAndGetReply("Send all peds", new TimeSpan(0, 0, 20));
 }
Пример #2
0
        private void initSocket()
        {
            //Initializing the Socket
            addLog("Connecting client to " + address + " and port " + port + "...");
            try {
                //Creating the client and signaling the state to the interface
                this.client = new SimpleTcpClient().Connect(address, port);
                addLog("Connected!");
                connectionButton.Text = TCP_TEXT_STOP;

                //add listener for server replies.
                client.DataReceived += Client_DataReceived;

            } catch( Exception ex) {
                addLog("Error connecting: " + ex.ToString());
            }
        }
Пример #3
0
 private void Form1_Load(object sender, EventArgs e)
 {
     client = new SimpleTCP.SimpleTcpClient();
     client.StringEncoder = Encoding.UTF8;
     client.DataReceived += Client_DataReceived;
 }