Socket Programming Question?

I wanna send data from PC to an Arduino+Ethernet Shield, I am using sockets, and coding program in C# as client, I can send data and read it on serial monitor, but whenever I send more than character from the PC I get this :
If I send one character ex"1", I get on the serial monitor : Value received 1
but if I send multiple character "120", I get this :
Value received: 1
Value received: 2
Value received: 0

C# send code :

void Button3Click(object sender, EventArgs e)
		{

			byte[] fwd = Encoding.ASCII.GetBytes("120");
			int bytesSent = sock.Send(fwd);	

			}

Arduino code :

EthernetClient client = server.available();  
  
while (client.connected()) {  
  
if (client.available()) {  
char c = client.read(); 
Serial.print("Value received:  ");  
Serial.println(c);

I wanna get "120" in serial monitor not 1 then 2 then 0...
Is it and Arduino Coding problem or C#?

client.read() only reads in a single character at a time. It's your responsibility to read in all available characters into an appropriately sized array to contain them prior to processing/parsing.

fyi, string is NOT an appropriate container to use.

I wanna get "120" in serial monitor not 1 then 2 then 0...

Then, you need to read and print the data correctly.

Is it and Arduino Coding problem

Yes.

if (client.available()) {  
char c = client.read(); 
Serial.print("Value received:  ");  
Serial.println(c);

You are sending "120" (that's '1', '2', and '0'). Then, you see if there is at least one character available to read, and, if so, you read exactly one character. That would be the '1' on one pass, then the '2' on another pass, and the '0' on another pass.

You need to send packets, with start and end markers, from the C# application, like "<120>". Then, use code like this to read it:

#define SOP '<'
#define EOP '>'

bool started = false;
bool ended = false;

char inData[80];
byte index;

void setup()
{
   Serial.begin(57600);
   // Other stuff...
}

void loop()
{
  // Read all serial data available, as fast as possible
  while(Serial.available() > 0)
  {
    char inChar = Serial.read();
    if(inChar == SOP)
    {
       index = 0;
       inData[index] = '\0';
       started = true;
       ended = false;
    }
    else if(inChar == EOP)
    {
       ended = true;
       break;
    }
    else
    {
      if(index < 79)
      {
        inData[index] = inChar;
        index++;
        inData[index] = '\0';
      }
    }
  }

  // We are here either because all pending serial
  // data has been read OR because an end of
  // packet marker arrived. Which is it?
  if(started && ended)
  {
    // The end of packet marker arrived. Process the packet

    // Reset for the next packet
    started = false;
    ended = false;
    index = 0;
    inData[index] = '\0';
  }
}

It worked perfectly!!
thank you All guys!!