A
Alakhim Mohamad
I'd like to send a message from server to client via socket with the
following code
...........server.........
string s="message";
Byte[] b=new Byte[1024];
b=ASCII.GetBytes(s);
socket.Send(b);
.............................
...........client...........
NetworkStream ns=client.getstream();
Byte[] b=new Byte[1024];
while((int i=ns.Read(b,0,b.Length)!=0)
{
string s=ASCII.GetString(b,0,i);
Console.Write("{0}",s);
}
...............................
This code is not correct right ? I see nothing on the client side at
all
Please help
Thanks
following code
...........server.........
string s="message";
Byte[] b=new Byte[1024];
b=ASCII.GetBytes(s);
socket.Send(b);
.............................
...........client...........
NetworkStream ns=client.getstream();
Byte[] b=new Byte[1024];
while((int i=ns.Read(b,0,b.Length)!=0)
{
string s=ASCII.GetString(b,0,i);
Console.Write("{0}",s);
}
...............................
This code is not correct right ? I see nothing on the client side at
all
Please help
Thanks