Re: server-socket on exit event

2009-10-16 Thread Emeka
Ngo, I checked out your github , it is great. I have not used netty, it looks clean. However, what is the meaning of this, (def reshedule nil)? Regards, Emeka On Thu, Oct 15, 2009 at 3:02 AM, ngocdaothanh ngocdaoth...@gmail.comwrote: I created this (Netty is used instead of server-socket):

Re: server-socket on exit event

2009-10-16 Thread ngocdaothanh
The snippet: --- (def reschedule nil) ; Forward declaration (defn broadcast [msg] (reschedule) (doall (map (fn [client] (send-msg client msg)) @clients))) --- (def

Re: server-socket on exit event

2009-10-14 Thread Emeka
Ngo, Honestly speaking I don't know. How far have you gone? Regards, Emeka On Sat, Oct 3, 2009 at 3:21 PM, ngocdaothanh ngocdaoth...@gmail.com wrote: Emeka, good catch. It's just my mistake. Another thing is I think there may be exception raised when on-msg sends message to a closed

Re: server-socket on exit event

2009-10-14 Thread ngocdaothanh
I created this (Netty is used instead of server-socket): http://github.com/ngocdaothanh/telchat-clojure I am going to create a Scala version of the same program to have a feeling of Clojure vs Scala, it will be telchat-scala. On Oct 14, 10:12 pm, Emeka emekami...@gmail.com wrote: Ngo,

Re: server-socket on exit event

2009-10-03 Thread Emeka
ngo, I was about doing this kind of client/server thing some days ago, however now you are into it I would like to learn then. I am not quite clear why you have this: (.start (new Thread (fn [] (create-server 8080 chat-loop My concern is on Thread, create-server function has a Thread inside

Re: server-socket on exit event

2009-10-03 Thread ngocdaothanh
Emeka, good catch. It's just my mistake. Another thing is I think there may be exception raised when on-msg sends message to a closed socket. How would you solve this? On Oct 3, 7:35 pm, Emeka emekami...@gmail.com wrote: ngo, I was about doing this kind of client/server thing some  days ago,

server-socket on exit event

2009-10-01 Thread ngocdaothanh
I want to write a simple socket server in Clojure. I want to perform some action when a client disconnects. I tried server-socket: http://richhickey.github.com/clojure-contrib/server-socket-api.html but it does not support on exit event. Is there a solution? Should I look at something like

Re: server-socket on exit event

2009-10-01 Thread Roger Gilliar
I want to write a simple socket server in Clojure. I want to perform some action when a client disconnects. --- The following code works for me. read-input returns nil if the socket is closed (the client disconnects) Regards Roger (defn read-input

Re: server-socket on exit event

2009-10-01 Thread ngocdaothanh
Roger, your code is not event based. I'm new to Clojure and as a small exercise I just want to create a simple chat server for telnet clients, any usable socket library is OK: * Chat messages are broadcast to all clients * When a client disconnect, all others will receive A client has

Re: server-socket on exit event

2009-10-01 Thread Roger Gilliar
Am 01.10.2009 um 21:28 schrieb ngocdaothanh: Roger, your code is not event based. What do you mean by not event based ? Regards Roger --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: server-socket on exit event

2009-10-01 Thread John Harrop
On Thu, Oct 1, 2009 at 4:02 PM, Roger Gilliar ro...@gilliar.de wrote: Am 01.10.2009 um 21:28 schrieb ngocdaothanh: Roger, your code is not event based. What do you mean by not event based ? He means he wants automatic notification if a connection is dropped. I'm not sure TCP/IP has a

Re: server-socket on exit event

2009-10-01 Thread ngocdaothanh
I'm not sure TCP/IP has a native facility for that. I'm afraid John's statement is correct: http://www.velocityreviews.com/forums/t125620-client-socket-disconnection-event-not-received-on-server-socket-java-nio.html and trying to read and write until something wrong happens as demonstrated in