471,599 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,599 software developers and data experts.

socket.send sends wait for another socket.send

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,SocketFl ags.None);

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

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

socketResultValue =
socket.Receive(mesajlar,0,mesajlar.Length,SocketFl ags.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

Nov 17 '05 #1
1 2231
Hi,

You have to send a terminator sequence for the receiver end knows the end
of the message, other way is to send the size in bytes you are to transfer.
then the receiver knows how many bytes to wait for
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Hasan O" <ho********@gmail.com> wrote in message
news:eR**************@TK2MSFTNGP12.phx.gbl...
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,SocketFl ags.None);

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

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

socketResultValue =
socket.Receive(mesajlar,0,mesajlar.Length,SocketFl ags.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

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by PH | last post: by
3 posts views Thread by Robert A. van Ginkel | last post: by
5 posts views Thread by Terry | last post: by
1 post views Thread by Saso Zagoranski | last post: by
4 posts views Thread by Sa¹o Zagoranski | last post: by
reply views Thread by Macca | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.