ppe.
> Le 27 mai 2014 09:44, "Dylan Gleason" a écrit :
>
>> I am trying to read a TCP request via an instance of DataInputStream and
>> am running into this error with the following code:
>>
>> (defn receive
>> [socket]
>> (with-open [reader
I am trying to read a TCP request via an instance of DataInputStream and am
running into this error with the following code:
(defn receive
[socket]
(with-open [reader (DataInputStream. (.getInputStream socket))]
(let [length (read-length reader)
bytes-in (byte-array length)
Silly error -- I neglected to bind DataInputStream to the socket's input
stream, i.e. (let [reader (DataInputStream. (.getInputStream socket))] ... )
On Thu, May 22, 2014 at 9:08 PM, Dylan Gleason wrote:
> I am working with the TCP server example from the *Clojure Cookbook* to
> cre
I am working with the TCP server example from the *Clojure Cookbook* to
create an echo server. I am trying to modify it so that the receive
function uses a DataInputStream and reads the incoming request as a byte
array. However, I am having difficulty getting it to work. Here is what I
have so
if you're doing a blocking operation within the
> function that handles the agent.
>
> I must admit I have no idea how the given code can yield inconsistent
> results. Does anyone know if agents, like refs, call the given functions
> speculatively? It would seem strange i
I have a TCP socket connection in which I need to process several requests
and conj each request and it's corresponding response to a vector for
logging purposes. I need to transmit and receive via two asynchronous
threads, where a transmit function is responsible for sending requests and
a r
I am trying to write a TCP client in Clojure for a networking assignment.
While everyone else is using C or C#, I elected to use Clojure and Java
sockets, but am naturally running into problems and can't figure out for
the life of me what I am doing wrong.
The goal is to send a message to the i