sockets send problem

  • Thread starter Thread starter Hasan O
  • Start date Start date
H

Hasan O

hi , I have a problem with socket.send

mesajlar = Encoding.ASCII.GetBytes("UGIR");

socketResultValue = socket.Send(mesajlar,0,mesajlar.Length,
SocketFlags.None);

socketResultValue =
socket.Receive(mesajlar,0,mesajlar.Length,SocketFlags.None);


mesajlar = Encoding.ASCII.GetBytes("UIST,1");

socketResultValue =
socket.Send(mesajlar,0,mesajlar.Length,SocketFlags.None);

socketResultValue =
socket.Receive(mesajlar,0,mesajlar.Length,SocketFlags.None);



this is the code i am using , It sends all together , so it makes error.
How can I handle this i mean

send UGIR and wait

send UIST,1 and wait and so on

?



thanks in advance
 
Hasan said:
hi , I have a problem with socket.send

mesajlar = Encoding.ASCII.GetBytes("UGIR");

socketResultValue = socket.Send(mesajlar,0,mesajlar.Length,
SocketFlags.None);

socketResultValue =
socket.Receive(mesajlar,0,mesajlar.Length,SocketFlags.None);
Try socket.Receive(mesajlar,0,socket.Available,SocketFlags.None);
mesajlar = Encoding.ASCII.GetBytes("UIST,1");

socketResultValue =
socket.Send(mesajlar,0,mesajlar.Length,SocketFlags.None);

socketResultValue =
socket.Receive(mesajlar,0,mesajlar.Length,SocketFlags.None);
Also: socket.Receive(mesajlar,0,socket.Available,SocketFlags.None);
this is the code i am using , It sends all together , so it makes error.
How can I handle this i mean

send UGIR and wait

send UIST,1 and wait and so on

?



thanks in advance

I hope it will help you.
£ukasz

PS. mesajlar ??? Is that in Hungarian?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top