473,569 Members | 2,701 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

stuck in stream.read plz HELP..

hi guys..
im writing an application that uses windows service to listen (as a
tcplistener) for any data sent (by a tcpclient) ...
one kind of the requests might be a file sent by client and the service
should recieve it as number of packets.
the problem is: in the windows service when it detects that the data
coming is a file it make a loop (which equals the number of packets the
client will send the file by it, which will be determined by the first
packet.)
BUT.. if the client (for some reason didnt send that number..) just
sent a less then the windows service got crazy!! will stuck at the line
" stream.read waiting for remaining packets.
is there a way that i can cancel the read after some timeout and let
the service continue the flow ??
thanks in advance.

Nov 29 '05 #1
0 990

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

Similar topics

11
3871
by: Amey Samant | last post by:
hi all i was trying to read an integer from keyboard with DataInputStream can someone explain the behaviour of the following code ???? <code> DataInputStream dis=new DataInputStream(System.in); DataOutputStream dout = new DataOutputStream(System.out); a=dis.readInt(); System.out.println("Using system.out a = "+a);
6
7346
by: Yechezkal Gutfreund | last post by:
I have been using the following code (successfully) to read Xml formated text packets from a TCP stream. The output from the server stream consists of a sequence of well formed Xml documents written to the output stream. We are willing to pay $ to any expert (e.g. MVP) consultant who has to time to help us track down this problem. (we...
14
19023
by: Laszlo Szijarto | last post by:
Can BinaryReader be forced to read a stream, say a TCP/IP stream or memory stream or even file stream in big endian order or do I have to write something custom to reverse the byte order? So, for example, I'd like a Windows client PC (native little endian) to be able to read a network stream coming in as big endian. I want to be able to read...
4
8716
by: Astronomically Confused | last post by:
using System; using System.Collections; using System.IO; using System.Net; using System.Net.Sockets; using System.Threading; class HttpProcessor { private Socket s;
3
1577
by: geoffblanduk_nospam | last post by:
Given a set of intervals {i1, i2, i3, ...} a list is produced; the base items (0) are placed one at a time into the stream and after the ix one a interval item (1, 2, 3, etc) of the correct type is created. When intervals intersect the order is kept (most frequent first). For example, given the intervals {2, 5, 10} I produce a stream of...
3
2212
by: frustrated | last post by:
I am trying to share a file stream between two threads, but havent got a clue as to how to do it. The first thread will be reading the file, and the second thread will(/might) be writing to the same file stream. I was going to pass a ref to the file stream to the second thread, but the problem comes when I am trying to read from one...
0
1055
by: Inspired | last post by:
hi guys.. im writing an application that uses windows service to listen (as a tcplistener) for any data sent (by a tcpclient) ... one kind of the requests might be a file sent by client and the service should recieve it as number of packets. the problem is: in the windows service when it detects that the data coming is a file it make a loop...
1
1563
by: mulham.haffar | last post by:
hi guys.. im writing an application that uses windows service to listen (as a tcplistener) for any data sent (by a tcpclient) ... one kind of the requests might be a file sent by client and the service should recieve it as number of packets. the problem is: in the windows service when it detects that the data coming is a file it make a loop...
5
2661
by: Hardy Wang | last post by:
Hi all, I am new to WSE 3.0, and currently reading the document shipped with installation. From sample provided (see below), I created WSE service side code, but how can I consume stream returned by web method in my Web Form application? I already configurated web.config of my web service by running WSE 3.0 setting tool. Thanks!
0
7697
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...
0
7612
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...
1
7672
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...
0
7968
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...
0
6283
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...
1
5512
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...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
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...

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.