stream

TcpClient and NetworkStream dispose problem.

I'm using this piece of code to process a connection to a server and read data from the client using(var client = _listener.EndAcceptTcpClient(ar)) { var clientStream = client.GetStream(); // Get the request message Messages.ReceiveMessage(clientStream, msg => ProcessRequest(msg, clientStream)); } Now, the Rec...

Load an encrypted XML file into a Dataset

I'm trying to decrypt an encrypted XML file and put it into a stream then load it into a dataset. I am able to do this if I decrypt the file, and write it back as a file. Then do the Dataset.ReadXML method. However, so I don't defeat the purpose of the encryption I'd like to leave it in memory. I see that .ReadXML does accept a syste...

Read content of RAR file into memory in Python

I'm looking for a way to read specific files from a rar archive into memory. Specifically they are a collection of numbered image files (I'm writing a comic reader). While I can simply unrar these files and load them as needed (deleting them when done), I'd prefer to avoid that if possible. That all said, I'd prefer a solution that's ...

[iPhone]: How send output stream via wireless network?

I want to write an app for a certain type of printer to print some text via wifi for iPhone. iPhone can join an existing wifi network by the Settings app, but how to create an output stream for the network so that the app can use it to send command to printer? I mean the wifi connection is set up already, how to get something like NSOu...

C# read unicode?

Hi. I am receiving a unicode message via the network, which looks like: 74 00 65 00 73 00 74 00 3F 00 I am using a BinaryReader to read the stream from my socket, but the problem is that it doesn't offer a "ReadWideString" function, or something similar to it. Anyone an idea how to deal with this? Thanks! ...

PHP mail error ... failed to open stream

I am trying to send email using PHP mail. I get the following error: Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 Fatal error: Unknown: Failed opening required '/home/webtest/help/ask_us.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0 The PHP code is as follows: <?php $...

What is a stream

What is a stream in the programming world ? Why do we need it ? Kindly explain with the help of an analogy, if possible. ...

Jw Player stops after a few seconds in Firefox

On chrome it works ok. My flash version is WIN 10,0,32,18 Debug: No This is the code that i wrote: <script type="text/javascript" src="/swfobject.js"></script> <div id="player"> <a href="http://www.macromedia.com/go/getflashplayer"&gt;Get the Flash Player</a> to see this player. </div> <script type="text/javascript"> var so = ne...

TClientDataSet - SaveToStream throws Access violation

I have a problem with saving data to stream with a ClientDataSet. I put data in the ClientDataSet and try to: ... var strmBENU: TMemoryStream; implementation ... TForm1.Button1Click(Sender: TObject); begin ClientDataSet1.SaveToStream(strmBENU); end; ... Clicking Button1, here is what I get: Access violation at adress 0049C...

sendasync (smtpclient) when using the token is sent byval and not byref?

it seem, after looking with reflector, that the sendasync(smtpclient) with the object token in the parameter of the function is byval does it make sense to try to release the attachment in the callback function? everywhere people(myself included) seem to do sendasync(mailmessage,mailmessage) and in the callback(SendCompletedCallback) ...

How to limit the maximum size read via ObjectInputStream from a Socket?

Is there a way to limit the maximum buffer size to be read from an ObjectInputStream in java? I want to stop the deserialization if it becomes clear that the Object in question is crafted maliciously huge. Of course, there is ObjectInputStream.read(byte[] buf, int off, int len), but I do not want to suffer the performance penalty of al...

TCP Client Connection

I have an application that I have written for my application distributed throughout the company to send data to me through our Windows 2003 server (running IIS 6.0). Small text messages get through, but larger messages containing more data (about 20 KB) are not getting through. I set the byte buffer to the TCP Client’s buffer size. I no...

WCF Service wtih Stream response

I have a WCF service and one of the method returns Stream. Now the question is while I try to consume that Stream object, am I trying to use the stream over the network or the client had received the full stream on its own side? Will it make any difference if I would have used RESTful instead of WCF? ...

How to determine whether it is EOF when using getline() in c++?

string s; getline(cin,s); while (HOW TO WRITE IT HERE?) { inputs.push_back(s); getline(cin,s); } ...

ASP.net continuous response stream

Hello. I was wondering how I would be able to send out a continuous response stream without closing it eventually. To better explain my question, think of the asp page as a proxy relaying a third party stream from a different source (audio stream or video stream broadcasted by another source) Obviously, Response.Write() or Response.Bina...

Reading and writing on webcam stream

Is it possible to use java to write into a webcam stream? I've tried JMF and got it to capture the image but couldn't find a possibility to write into the stream. ...

Reading Image from Web Server in C# proxy.

I am trying to write a proxy which reads an image from one server and returns it to the HttpContext supplied, but I am just getting character stream back. I am trying the following: WebRequest req = WebRequest.Create(image); WebResponse resp = req.GetResponse(); Stream stream = resp.GetResponseStream(); StreamReader sr = new StreamRead...

PHP technique to query the APNs Feedback Server

Hi all, Can someone clarify what the APNs (Apple Push Notification) wants as far as how you query it? The docs say it starts sending as soon as the connection is made. Does this mean that I don't do an fread() on it? Here's my current code to try and read it. I did NOT put the fread() in a loop as I do not know what response indicates...

Safely overloading stream operator>>

There's a ton of information available on overloading operator<< to mimic a toString()-style method that converts a complex object to a string. I'm interested in also implementing the inverse, operator>> to deserialize a string into an object. By inspecting the STL source, I've gathered that: istream &operator>>(istream &, Object &); ...

Can i put binary in stdin? C#

Related to this question http://stackoverflow.com/questions/1284088/encrypt-binary-with-7z-without-filenames/1284101#1284101 In C# how can i put binary in STDin? i was hoping the below would work but it doesnt. And it makes sense. So how do i push a byte[] array? new BinaryWriter(p.StandardInput.FormatProvider); ...