title: How to convert the Serial out of a Arduino to socket out put(Lan network)
body: <p>The below sketch have a serial output at the end of the sketch.
  "(Serial.println(stringTwo);)"
  How to convert it to a socket output. I want to read the out using a c# program through lan network.</p>
  
  <p>===========</p>
  
  <h1>Sketch</h1>
  
  <pre><code>int LED= 2;
  int LED3= 3;
  int LED4= 4;
  int LED5= 5;
  int LED6= 6;
  int LED7= 7;
  int LED8= 8;
  int LED9= 9;
  int LED10= 10;
  int LED11= 11;
  int LED12= 12;
  char k='F';
  char a='F';
  char b='F';
  char c='F';
  char d='F';
  char e='F';
  char f='F';
  char g='F';
  char h='F';
  char i='F';
  char j='F';
  
  
  char data;
  char x='f';
  
  char con[80];
  int analogpin=3;
  void setup() {
    {
      Serial.begin(9600);
      pinMode(LED,OUTPUT);
      pinMode(LED3,OUTPUT);
      pinMode(LED4,OUTPUT);
      pinMode(LED5,OUTPUT);
      pinMode(LED6,OUTPUT);
      pinMode(LED7,OUTPUT);
      pinMode(LED8,OUTPUT);
      pinMode(LED9,OUTPUT);
      pinMode(LED10,OUTPUT);
      pinMode(LED11,OUTPUT);
      pinMode(LED12,OUTPUT);
      pinMode(analogpin,INPUT);
      Serial.begin(9600);
    }
  
  }
  
  void loop() {
    ////////////////
     int value = analogRead(analogpin);
     String stringOne =String(value);
  
    ////////////////////////////////
   data= Serial.read();
  
  ////////////////////////////
  
    if (data == 'o')
      {
       k='O';
      }
      else if (data == 'p')
        {
         k= 'F';
        }
        else if (data == ' ')
        {
          k= 'F';
        }
  
         if  (data=='o')
     {
      digitalWrite(LED,HIGH);
      x = data;
      }
      else if (data=='p')
      {
        digitalWrite(LED,LOW);
        x = data;
        }
  
  ///////////////////////////////////
  /*if (data !='o'||data !='p')
    {
      data=x;
      }*/
  //////////////////////////////////////
  /////////////////////////////
  
  if  (data=='A')
     {
      digitalWrite(LED3,HIGH);
      a = 'O';
     }
    else if (data=='a')
      {
      digitalWrite(LED3,LOW);
      a  = 'F';
      }
  ////////////////////////////
  
      if  (data=='B')
     {
      digitalWrite(LED4,HIGH);
      b = 'O';
     }
    else if (data=='b')
      {
      digitalWrite(LED4,LOW);
      b = 'F';
      }
  
  /////////////////////////////
  
      if  (data=='C')
     {
      digitalWrite(LED5,HIGH);
      c = 'O';
     }
    else if (data=='c')
      {
      digitalWrite(LED5,LOW);
      c = 'F';
      }
  
  ///////////////////////
  
      if  (data=='D')
     {
      digitalWrite(LED6,HIGH);
      d = 'O';
     }
    else if (data=='d')
      {
      digitalWrite(LED6,LOW);
      d = 'F';
      }
   ///////////////////////
  
      if  (data=='E')
     {
      digitalWrite(LED7,HIGH);
      e = 'O';
     }
    else if (data=='e')
      {
      digitalWrite(LED7,LOW);
      e = 'F';
      }
   /////////////////////
  
      if  (data=='F')
     {
      digitalWrite(LED8,HIGH);
      f = 'O';
     }
    else if (data=='f')
      {
      digitalWrite(LED8,LOW);
      f = 'F';
      }
      ////////////////
  
      if  (data=='G')
     {
      digitalWrite(LED9,HIGH);
      g = 'O';
     }
    else if (data=='g')
      {
      digitalWrite(LED9,LOW);
      g = 'F';
      }
      ////////////
  
      if  (data=='H')
     {
      digitalWrite(LED10,HIGH);
      h = 'O';
     }
    else if (data=='h')
      {
      digitalWrite(LED10,LOW);
      h = 'F';
      }
      ///////////
  
      if  (data=='I')
     {
      digitalWrite(LED11,HIGH);
      i = 'O';
     }
    else if (data=='i')
      {
      digitalWrite(LED11,LOW);
      i = 'F';
      }
      //////////////
  
      if  (data=='J')
     {
      digitalWrite(LED12,HIGH);
      j = 'O';
     }
    else if (data=='j')
      {
      digitalWrite(LED12,LOW);
      j = 'F';
      }
  
   String sco(k);
  String scoa(a);
  String scob(b);
  String scoc(c);
  String scod(d);
  String scoe(e);
  String scof(f);
  String scog(g);
  String scoh(h);
  String scoi(i);
  String scoj(j);
  
  
  String stringTwo= sco;
  String string3=scoa;
  String string4=scob;
  String string5=scoc;
  String string6=scod;
  String string7=scoe;
  String string8=scof;
  String string9=scog;
  String string10=scoh;
  String string11=scoi;
  String string12=scoj;
  
  
  
       stringTwo.concat(string3);
       stringTwo.concat(string4);
       stringTwo.concat(string5);
       stringTwo.concat(string6);
       stringTwo.concat(string7);
       stringTwo.concat(string8);
       stringTwo.concat(string9);
       stringTwo.concat(string10);
       stringTwo.concat(string11);
       stringTwo.concat(string12);
       stringTwo.concat(stringOne);
  
  
        Serial.println(stringTwo);
       delay(100);
  }
  </code></pre>
  
  <p>I already developed a  program to read the above sketch out using usb serial port. now i need it through lan network. </p>