By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,638 Members | 1,983 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,638 IT Pros & Developers. It's quick & easy.

socket.send sends wait for another socket.send

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.