473,789 Members | 2,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Blocking stream & converting

Hi,

1. How can I read stream in blocking mode? Meaning stop the thread till it
get a new line sign?

Or getting an event from the stream on new income data?

2. How can I convert 2 bytes to char?

Thanks

Guy
Nov 15 '05 #1
1 1740
Guy,

Where are you reading this from? If you are reading from a network
stream, then it will block until there is data on the line (I believe). If
you are reading from a console, then you can just call the readline method,
and it will block until a new line is entered into the console.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Guy Korland" <ko*****@cs.tec hnion.ac.il> wrote in message
news:ug******** ******@TK2MSFTN GP09.phx.gbl...
Hi,

1. How can I read stream in blocking mode? Meaning stop the thread till it
get a new line sign?

Or getting an event from the stream on new income data?

2. How can I convert 2 bytes to char?

Thanks

Guy

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4378
by: Christopher H. Laco | last post by:
I'm having a problem with the TcpClient that I can only conclude is either a feature, or a complete misunderstanding of the docs on my part. In a nutshell, I'm simply performing the following sequence with a server: connect write(50 bytes) read(2002 bytes) write(50 bytes) read(2002 bytes)
3
12270
by: Mario | last post by:
Hello, I couldn't find a solution to the following problem (tried google and dejanews), maybe I'm using the wrong keywords? Is there a way to open a file (a linux fifo pipe actually) in nonblocking mode in c++? I did something ugly like --- c/c++ mixture --- mkfifo( "testpipe", 777);
3
3710
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.
7
17417
by: Michi Henning | last post by:
Hi, I'm using a non-blocking connect to connect to a server. Works fine -- the server gets and accepts the connection. However, once the connection is established, I cannot retrieve either the local or the remote endpoint from the client-side socket. The *really* strange thing is that Socket.LocalEndPoint is null. According to the doc, that's impossible: reading the LocalEndPoint
2
11288
by: Nad | last post by:
Hello All, I have been trying to get some sort of documantion on how StreamReader.ReadToEnd() finds out if the stream has ended and if anyone can read the following lines and tell me how to control indefinite blocking issue. these are from MSDN. "ReadToEnd assumes that the stream knows when it has reached an end. For interactive protocols, in which the server sends data only when you ask for it and does not close the connection,...
1
22809
by: Sagaert Johan | last post by:
Hi Ii have a simple server thread in an app that listens for connections, for some unclear reason an exception is thrown every now and then : 'A blocking operation was interrupted by a call to WSACancelBlockingCall ' Any suggestion why this may happen ? The Exception is thrown by the svr.AcceptTcpClient() method See source below.
3
10760
by: bernardpace | last post by:
Hi, I am writing to a network stream using the following code: TcpClient client = new TcpClient(); client.Connect(IPAddress.Parse("192.168.2.100"), 55650); NetworkStream stream = client.GetStream(); StreamWriter writer = new StreamWriter(stream); writer.Write("TEST"); writer.Flush();
3
4595
by: g66g08d14 | last post by:
Hi. We have a Jabber-esque client server package that uses XMPP for communication over network sockets. Using .NET 2.0, I need to read a full stanza (i.e. balanced xml) as soon as available and return it as a string. So, I've taken my NetworkStream and wrapped an XmlTextReader around it. At first I tried using ReadOuterXml() to grab the full stanza. This
1
1095
by: Antoon Pardon | last post by:
In the RawIOBase class I read the following: ..read(n: int) -bytes Read up to n bytes from the object and return them. Fewer than n bytes may be returned if the operating system call returns fewer than n bytes. If 0 bytes are returned, this indicates end of file. If the object is in non-blocking mode and no bytes are available, the call returns None.
0
9511
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
10199
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
10139
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
9983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6768
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
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3697
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
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.