473,776 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

socket.send sends wait for another socket.send

hi , I have a problem with socket.send

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

socketResultVal ue = socket.Send(mes ajlar,0,mesajla r.Length,
SocketFlags.Non e);

socketResultVal ue =
socket.Receive( mesajlar,0,mesa jlar.Length,Soc ketFlags.None);

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

socketResultVal ue =
socket.Send(mes ajlar,0,mesajla r.Length,Socket Flags.None);

socketResultVal ue =
socket.Receive( mesajlar,0,mesa jlar.Length,Soc ketFlags.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 2366
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********@gma il.com> wrote in message
news:eR******** ******@TK2MSFTN GP12.phx.gbl...
hi , I have a problem with socket.send

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

socketResultVal ue = socket.Send(mes ajlar,0,mesajla r.Length,
SocketFlags.Non e);

socketResultVal ue =
socket.Receive( mesajlar,0,mesa jlar.Length,Soc ketFlags.None);

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

socketResultVal ue =
socket.Send(mes ajlar,0,mesajla r.Length,Socket Flags.None);

socketResultVal ue =
socket.Receive( mesajlar,0,mesa jlar.Length,Soc ketFlags.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
5241
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 computer wait til the local buffer reaches a treshold before it sends? if so, how do i extract each structure with its corresponding header and body? I can find only htons and htonl for byte ordering conversion. What do I do with a struct that's,...
3
3709
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 tried this I don't see any diffents, I am sending 10Mb and the Send/BeginSend command doesn't wait till the data is on the remotepoint. Can somebody pls. explain this. Regards Robert.
5
11714
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, that the "recvFrom()" call should just continue blocking. Right? What I'm seeing is that when I send a packet to a particular address that is not responding, my "recvFrom()" call throws an exception. I get "An existing connection was forcibly...
1
3849
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
2352
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
2959
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
3604
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 that its buffer is bigger than this. I did this expecting the data to be read in one pass.
0
4688
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 number of different types of data coming in. I have a databuffer for each type of data coming in.
1
7186
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 site, which is actually for sending strings. I tried to adapt this code so that the client sends an image instead of a string. However, there is something wrong on the server side (i guess)... The server starts listening, the client starts sending...
0
9628
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9464
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8954
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7471
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6722
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5368
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2860
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.