473,320 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 2340
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: PH | last post by:
Hi, I need a bit of explanation (or pointers to online references) on socket programming in linux. How do I send a data structure over the internet and how mtu affects the data flow? does the...
3
by: Robert A. van Ginkel | last post by:
In news:OZ0W9RsdDHA.2432@TK2MSFTNGP10.phx.gbl... I ask the question how I can see if all the data is on the other side of the connection. I got as answer that I should use the blocking property. I...
5
by: Terry | last post by:
It's my understanding of UDP sockets that if there is a thread blocked on a "recvFrom()" call and other thread sends a UDP packet to some address, that if the machine on the other end isn't up,...
1
by: Saso Zagoranski | last post by:
Hi! I have simple client/server game that uses sockets to transfer different messages. The server and the client are running on the same machine.
4
by: Sa¹o Zagoranski | last post by:
Hi! I'm writing a simple 3D First person shooter game. It is a multiplayer game, where all the players connect to one server.
1
by: Kueishiong Tu | last post by:
How do I send and receive internet messages using socket in the .net VC++ environment? Coding sample will be helpful.
9
by: Macca | last post by:
Hi, I have a synchronous socket server which my app uses to read data from clients. To test this I have a simulated client that sends 100 byte packets. I have set up the socket server so...
0
by: Macca | last post by:
Hi, I am writing an asychronous socket server to handle 20+ simulataneous connections. I have used the example in MSDN as a base. The code is shown at end of question. Each connection has a...
1
by: keksy | last post by:
Hi every1, I am writing a small client/server application and in it I want to send an image asynchronous from the client to the server through a TCP socket. I found an example code on the MSDN...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.