From mickael.remond@REDACTED Wed Mar 15 13:53:41 2006 From: mickael.remond@REDACTED (Mickael Remond) Date: Wed, 15 Mar 2006 13:53:41 +0100 Subject: Jinterface addition In-Reply-To: <11498CB7D3FCB54897058DE63BE3897C015D7571@esealmw105.eemea.ericsson.se> References: <11498CB7D3FCB54897058DE63BE3897C015D7571@esealmw105.eemea.ericsson.se> Message-ID: <20060315125341.GA18262@memphis.ilius.fr> * Vlad Dumitrescu XX (LN/EAB) [2006-03-15 13:00:06 +0100]: > Hi, > > Here is an addition to OtpEpmd.java, allowing programs to retrieve the > list of registered nodes. Hello, I take the opportunity to submit another JInterface patch, developed by a coworker (Nicolas Blanc). GenericQueue has been patched to add a method to get a non-synchronized compteur for the number of object in the queue. This information is moving a lot and synchronisation does not seem relevant in this case. If you want to take decision based on the result of this function if will most likely have changed in the meantime. The method getCount has also been added to OtpMbox to get the number of messages waiting in a mailbox. It uses the method getUnsynchronizedCount of GenericQueue. I hope this helps, -- Micka?l R?mond http://www.process-one.net/ -------------- next part -------------- --- GenericQueue.java.orig 2006-03-10 10:11:09.000000000 +0100 +++ GenericQueue.java 2006-03-06 16:11:54.000000000 +0100 @@ -143,6 +143,10 @@ return count; } + public int getUnsynchronizedCount() { + return count; + } + /* * The Bucket class. The queue is implemented as a linked list * of Buckets. The container holds the queued object and a -------------- next part -------------- --- OtpMbox.java.orig 2006-03-10 10:11:10.000000000 +0100 +++ OtpMbox.java 2006-03-06 16:12:18.000000000 +0100 @@ -648,4 +648,8 @@ } } } + + public int getCount() { + return this.queue.getUnsynchronizedCount(); + } } From mbj@REDACTED Sun Mar 19 23:38:18 2006 From: mbj@REDACTED (Martin Bjorklund) Date: Sun, 19 Mar 2006 23:38:18 +0100 (CET) Subject: ftp.erl Message-ID: <20060319.233818.10959148.mbj@tail-f.com> Here's a patch to handle file errors from the FTP server. I don't know exactly when this happens, but I use the send_chunk* functions. Without this patch I get: =ERROR REPORT==== 19-Mar-2006::23:19:30 === ** Generic server <0.174.0> terminating ** Last message in was {tcp,#Port<0.245>, <<"553 Permission denied! ">>} ** When Server state == {state,#Port<0.245>, {lsock,#Port<0.247>}, false, "/home/mbj/src/tailf-src/trunk", ftp_server_default, false, active, 60000, <<"">>, {<<"">>,[],start}, <0.158.0>, {<0.158.0>,#Ref<0.0.0.858>}, start_chunk_transfer, false, ignore} ** Reason for termination == ** {bad_return_value,{stop,normal, {error,efnamena}, {state,#Port<0.245>, {lsock,#Port<0.247>}, false, "/home/mbj/src/tailf-src/trunk", ftp_server_default, false, active, 60000, <<"">>, {<<"">>,[],start}, <0.158.0>, undefined, start_chunk_transfer, false, ignore}}} And the simple patch: nassa ftp> diff -C2 ftp.erl /home/mbj/src/tailf-src/trunk/otp/lib/inets/src/ftp/ftp.erl *** ftp.erl Wed Oct 12 17:17:36 2005 --- /home/mbj/src/tailf-src/trunk/otp/lib/inets/src/ftp/ftp.erl Sun Mar 19 23:33:58 2006 *************** *** 1224,1228 **** %Status == etnospc; Status == epnospc; Status == econn -> gen_server:reply(From, {error, Status}), ! {stop, normal, {error, Status}, State#state{client = undefined}}; ctrl_result_response(_, #state{client = From} = State, ErrorMsg) -> --- 1224,1228 ---- %Status == etnospc; Status == epnospc; Status == econn -> gen_server:reply(From, {error, Status}), ! {stop, normal, State#state{client = undefined}}; ctrl_result_response(_, #state{client = From} = State, ErrorMsg) -> From mbj@REDACTED Mon Mar 20 00:08:38 2006 From: mbj@REDACTED (Martin Bjorklund) Date: Mon, 20 Mar 2006 00:08:38 +0100 (CET) Subject: ftp.erl (2) Message-ID: <20060320.000838.127181066.mbj@tail-f.com> Another patch - handle that the owning process terminates w/ reason 'shutdown', w/o reporting this as an error. nassa ftp> diff -C2 ftp.erl /home/mbj/src/tailf-src/trunk/otp/lib/inets/src/ftp/ftp.erl *** ftp.erl Wed Oct 12 17:17:36 2005 --- /home/mbj/src/tailf-src/trunk/otp/lib/inets/src/ftp/ftp.erl Mon Mar 20 00:05:45 2006 *************** *** 873,876 **** --- 873,879 ---- handle_info({'DOWN', _Ref, _Type, _Process, normal}, State) -> {stop, normal, State#state{client = undefined}}; + + handle_info({'DOWN', _Ref, _Type, _Process, shutdown}, State) -> + {stop, normal, State#state{client = undefined}}; handle_info({'DOWN', _Ref, _Type, _Process, timeout}, State) -> /martin