Send data via ESP8266 to tcp

Hi, I created a mini server (without using original wifiserver sample).

how can I send message to connected phone?
here is my code, I want to send some message to phone(first connection), but I don’t know how.

I use this code to send my message, is this right?

            String str = "turned off";
            Serial.println(str); 
            ESP8266.println("AT+CIPSEND=0,"+ str.length());
            delay(500);
            ESP8266.println("AT+CIPSEND=0,"+ str);

Is my codes is right to send data to first connection?

here is my all code:

#include <SoftwareSerial.h>

const byte rxPin = 2;
const byte txPin = 3;

SoftwareSerial ESP8266 (rxPin, txPin);

unsigned long lastTimeMillis = 0;

void setup() {
  pinMode(5,OUTPUT);
  Serial.begin(9600);   
  ESP8266.begin(115200);
  delay(500);
  ESP8266.println("AT+CIPSTA=\"192.168.1.195\",\"192.168.1.1\",\"255.255.255.0\"");
  delay(500);
  ESP8266.println("AT+CIPMUX=1");
  delay(1000);    
  ESP8266.println("AT+CIPSERVER=1,11000");
  delay(1000);

  Serial.println("");
  Serial.println("Server is Ready");
  Serial.println("");    
}

void printResponse() {
  while (ESP8266.available()) {
    Serial.println(ESP8266.readStringUntil('\n')); 
  }
}

void loop() {

    if ( ESP8266.available() )  
    {  
       Serial.write( ESP8266.read());  
       String result = ESP8266.readString();
       delay(500);
       Serial.println("salam: " +result); 
       //if(result.indexOf("<EOM")>0)
       {
          if(result.indexOf("on")>0)
          {
            String str = "turned on";
            Serial.println(str); 
            digitalWrite(5,LOW);
            //AT+CIPSEND=
            ESP8266.println("AT+CIPSEND=0,"+ str.length());
            delay(500);
            ESP8266.println("AT+CIPSEND=0,"+ str);
          }
          else if(result.indexOf("off")>0)
          {
            String str = "turned off";
            Serial.println(str); 
            digitalWrite(5,HIGH);
            
            ESP8266.println("AT+CIPSEND=0,"+ str.length());
            delay(500);
            ESP8266.println("AT+CIPSEND=0,"+ str);
          }
          else
          {
	    // do something
          }
       }
    }

    if ( Serial.available())
    {  
      ESP8266.write( Serial.read() );
    } 

}

Thanks

If you want to send general text messages over wifi then use UDP. The ethernet and wifi libraries include a UDP server/client examples.

But be aware that if you try and do both in your sketch, i.e. send a receive both http and UDP data, then UDP data packets will arrive at a http client not a UDP client.

Or at least that is what happens in the WiFiEsp library. There was a bug in that library that I had to hack my way around so that a UDP packet ended up arriving through a UDP client.

I suspect that the same bug exists in other similar libraries because it was not envisaged that some one (me) would write a sketch that wants to use both UDP and http in the same sketch.