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)); }
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()); } }
private void Form1_Load(object sender, EventArgs e) { client = new SimpleTCP.SimpleTcpClient(); client.StringEncoder = Encoding.UTF8; client.DataReceived += Client_DataReceived; }