How to send a String by esp8266

Hi, I'm trying to reuse the WiFiTelnetToSerial example code:

//check UART for data
if(Serial.available()){
size_t len = Serial.available();
uint8_t sbuf[len];
Serial.readBytes(sbuf, len);
//push UART data to all connected telnet clients
for(i = 0; i < MAX_SRV_CLIENTS; i++){
if (serverClients && serverClients*.connected()){*
_ serverClients*.write(sbuf, len);
delay(1);
}
}[/quote]
```_
 char msg[10] = "123456789";

for (i = 0; i < 10; i++) {            
   if (serverClients[i] && serverClients[i].connected()) {
     serverClients[i].write((const uint8_t ) msg, 10);
     delay(1);
   }
 }

*_</em> <em>_*to send a string to a client, but I have errors, someone could tell me what my error is, my sketch*_</em> <em>_*is restarts continuously?*_</em> <em>_*Here is my error:*_</em> <em>_*> ESP ready*_</em> <em>_*> Server IP is : 192.168.4.1*_</em> <em>_*> Port is : 8888*_</em> <em>_*>*_</em> <em>_*> Exception (28):*_</em> <em>_*> epc1=0x40201280 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000038 depc=0x00000000*_</em> <em>_*>*_</em> <em>_*> >>>stack>>>*_</em> <em>_*Here is my complet code*_</em> <em>_*
*#include <ESP8266WiFi.h>
#include <EEPROM.h>
#include <WiFiClient.h>

#define SERIALBAUD    115200
#define MAXCLIENTS    4

//Access Point data
const char* ssid = "TES_ESP8266";
const char* password = "12345678";

const int LED_PIN = 2;
unsigned int localPort = 8888;
WiFiServer server(localPort);
//Server clients
WiFiClient serverClients[MAXCLIENTS];

void setup() {
  pinMode(LED_PIN, OUTPUT);
  digitalWrite(LED_PIN, HIGH);
  EEPROM.begin(512);

Serial.begin(SERIALBAUD);

//Start Access Point
  WiFi.disconnect(true);
  WiFi.mode(WIFI_AP);
  WiFi.softAP(ssid, password);

//Start Server
  server.begin();
  server.setNoDelay(true);

//Initialization finished
  Serial.println(); Serial.println();
  Serial.println("ESP ready");
  Serial.print("Server IP is : "); Serial.println(WiFi.softAPIP());
  Serial.print("Port is : ");
  Serial.println(localPort);
}

void loop() {
  uint8_t i;
  if (server.hasClient()) {          //check if there are any new clients
    for (i = 0; i < MAXCLIENTS; i++) {
      if (!serverClients[i] || !serverClients[i].connected()) {  //find free/disconnected spot
        if (serverClients[i])
          serverClients[i].stop();

serverClients[i] = server.available();
        //Serial.print("New client: "); Serial.print(i);
        continue;
      }
    }
    //no free/disconnected spot so reject
    WiFiClient serverClient = server.available();
    serverClient.stop();
    //Serial.println("No client slot available");
  }

//check clients for data
  for (i = 0; i < MAXCLIENTS; i++) {
    if (serverClients[i] && serverClients[i].connected()) {
      if (serverClients[i].available()) {
        digitalWrite(LED_PIN, LOW);
        //get data from the telnet client and push it to the UART
        while (serverClients[i].available())
          Serial.write(serverClients[i].read());
      }
      digitalWrite(LED_PIN, HIGH);
    }
  }

//  //check UART for data
  //  if(Serial.available()) {
  //    digitalWrite(LED_PIN, LOW);
  //    size_t len = Serial.available();
  //    uint8_t sbuf[len];
  //    Serial.readBytes(sbuf, len);
  //    for(i = 0; i < MAXCLIENTS; i++) {            //push UART data to all connected telnet clients
  //      if (serverClients[i] && serverClients[i].connected()) {
  //        serverClients[i].write(sbuf, len);
  //        delay(1);
  //      }
  //    }
  //  }

//check UART for data
  char msg[10] = "123456789";
  for (i = 0; i < 10; i++) {
    if (serverClients[i] && serverClients[i].connected()) {
      serverClients[i].write((const uint8_t ) msg, 10);
      delay(1);
    }
  }
}

```

Your error is not posting the error message you are receiving. You have also not posted your entire sketch. Please read the sticky post at the top of the forum about how to post your code and your error messages. It helps people help you.