From Sean.Hinde@REDACTED Tue May 1 16:44:01 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Tue, 1 May 2001 15:44:01 +0100 Subject: Heap based mutable arrays? Message-ID: <402DD461F109D411977E0008C791C312039F5F40@imp02mbx.one2one.co.uk> All, Support for mutable arrays has almost got to the point of a FAQ. The current choices seem to be: tuples - slow when of any decent size due to the copying involved ets - quite a lot of fixed overhead (min 50uS on my machine). clever combinations of smaller tuples such as dynarray and friends.. not too bad - comparable to ets. We hear that supporting automatically mutable tuples is not possible due to the nature of the current garbage collector - in R8 there is an optimisation for multiple updates in one go within a record but it still gets copied. So.. Why not have a new bif library called e.g array with the same semantics as ets but without the hashing and buckets overhead? It could have much the same interface as ets e.g. A = array:new(array_name, [{initial_offset, 1}, {max_index, 1000}]). array:insert(A, N, Term). array:delete(A, N). array:update_counter(A, N, 1). array:delete(A). It would have the same copying overhead as ets (copying the term to the heap - unless storing a large binary) but this is probably not the end of the world. I don't see there would be a need for garbage collection - just delete the whole thing on the demise of the creating process. It would need to do some tidying up work in the background if we insert a larger term than last time (or some default minimum?) Any thoughts? - Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From thomasl@REDACTED Wed May 2 14:43:23 2001 From: thomasl@REDACTED (Thomas Lindgren) Date: Wed, 2 May 2001 11:43:23 -0100 Subject: Heap based mutable arrays? In-Reply-To: <402DD461F109D411977E0008C791C312039F5F40@imp02mbx.one2one.co.uk> (message from Sean Hinde on Tue, 1 May 2001 15:44:01 +0100) References: <402DD461F109D411977E0008C791C312039F5F40@imp02mbx.one2one.co.uk> Message-ID: <200105021243.f42ChND19294@lammgam.bluetail.com> > Support for mutable arrays has almost got to the point of a FAQ. > > The current choices seem to be: > > tuples - slow when of any decent size due to the copying involved > ets - quite a lot of fixed overhead (min 50uS on my machine). > clever combinations of smaller tuples such as dynarray and friends.. not too > bad - comparable to ets. HIPE used a third solution for a long time. However, it requires support from a generational garbage collector, since it relies on destructive updates 'under the hood'. The HIPE solution I wrote had these characteristics: - declarative, so old versions of array still available if needed - constant time access (read/write) to the most recent version Here is the implementation. The idea was taken from Prolog work in the 80's (shown in manly ascii graphics): 1. There is no direct access to the array per se; all accesses go through a _handle_ which is updated to reflect array changes The original array is implemented as a tuple (array) with a handle: -> 2. How to write element N with value V1 and old value V0: -> -> ^ | --+ Thus: (a) an exception element is allocated (b) the array/tuple is updated with N := V1 (c) a new handle is allocated to point to the array (d) the new handle is returned This is a constant time operation, but of course not as cheap as a direct update. 3. How to look up an element N in array (starting from a handle): - if there is an exception chain, check if N occurs in the chain; if so, return that value - otherwise, return element N of the array Accessing the most recent array is thus a constant time operation, since there is no exception list to scan. What were the drawbacks: - Implemented in Erlang (except for the destructive update), so one could subvert the implementation. By moving to C, handles etc can be made invisible (just like they are for binaries). - The exception chain is costly if an old array is used. This can be solved by using another method for lookup: if an exception chain is found, _copy_ the array, install the exception chain in the copy and repoint the handle to the new array. (This can also be done at GC-time.) The effect: constant time access to the old array (after the copy), but sometimes requires more space. Also thrashing if a single lookup is made in the old array. (What to do requires more study, I suspect; the policy could be handled by setting options at array creation time.) - Possibilities to create circular references, and references from the old generation to the new generation in a gen-gc system. There are well-known solutions to this, since almost all gen-gcs have to handle the problem. (Basically, keep a stack or list of pointers from old to new generation; push a new element when such a pointer is created.) I think some other copying functions in erts rely on non-circularity, which also needs changing. What were the advantages: - Very useful, in short :-) For HIPE, graph algorithms became much more pleasant. I also implemented hash tables on top of the arrays, which rapidly spread through the compiler. Many common algorithms are much easier to write when your array ADT has the right complexity. I know there has been discussions about implementing something like this in OTP, but I don't know the precise status. Bj?rn G. probably knows more :-) Thomas -- Thomas Lindgren thomas+junk@REDACTED Alteon WebSystems From bjorn@REDACTED Wed May 2 12:30:50 2001 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 02 May 2001 12:30:50 +0200 Subject: Heap based mutable arrays? In-Reply-To: Thomas Lindgren's message of "Wed, 2 May 2001 11:43:23 -0100" References: <402DD461F109D411977E0008C791C312039F5F40@imp02mbx.one2one.co.uk> <200105021243.f42ChND19294@lammgam.bluetail.com> Message-ID: Thomas Lindgren writes: . . . > > I know there has been discussions about implementing something like > this in OTP, but I don't know the precise status. Bj?rn G. probably > knows more :-) Actually, the code for a vector type is included in R7B, but the BIFs used to create vectors (vector:new/2 and vector:from_list/1) are disabled. By a few simple changes to the erl_vector.c source file in the open source distribution vector support can be enabled. The following features are not implemented (and will crasch the emulator if you try to use them): - Term comparisions of whole vectors. - Taking hash values of vectors. - term_to_binary(Vector) - Creating circular terms will cause an infinite loop in term copying (and perhaps in other places). I bypass the garbage collection problem by forcing a fullsweep collection as soon as any vector is updated. My time measurements were somewhat of a disappointment. You'll get a noticeable performance improvement if you use vectos with many elements (typically more than several hundred elements) compared to using a tuple of the same size, but for many algorithm data structures using lists and/or tuples are faster than vectors. Vectors may get more useful if we'll fix the garbage collector (implementing a proper write barrier). /Bjorn -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From thomasl@REDACTED Wed May 2 15:35:42 2001 From: thomasl@REDACTED (Thomas Lindgren) Date: Wed, 2 May 2001 12:35:42 -0100 Subject: Heap based mutable arrays? In-Reply-To: (message from Bjorn Gustavsson on 02 May 2001 12:30:50 +0200) References: <402DD461F109D411977E0008C791C312039F5F40@imp02mbx.one2one.co.uk> <200105021243.f42ChND19294@lammgam.bluetail.com> Message-ID: <200105021335.f42DZgP20657@lammgam.bluetail.com> > I bypass the garbage collection problem by forcing a fullsweep collection > as soon as any vector is updated. /.../ > > My time measurements were somewhat of a disappointment. You'll get a > noticeable performance improvement if you use vectos with many > elements (typically more than several hundred elements) compared to > using a tuple of the same size, but for many algorithm data > structures using lists and/or tuples are faster than vectors. I'm impressed that you see any improvement at all ... the copying work in a full sweep sounds much larger than copying a single tuple, even if the tuple is large. Anyway, good work and here's to a write barrier in subsequent versions. Thomas -- Thomas Lindgren thomas+junk@REDACTED Alteon WebSystems From Sean.Hinde@REDACTED Wed May 2 12:38:47 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Wed, 2 May 2001 11:38:47 +0100 Subject: Heap based mutable arrays? Message-ID: <402DD461F109D411977E0008C791C312039F5F4C@imp02mbx.one2one.co.uk> Thomas, > > Support for mutable arrays has almost got to the point of a FAQ. > HIPE used a third solution for a long time. However, it > requires support > from a generational garbage collector, since it relies on destructive > updates 'under the hood'. Yes, my understanding (from reading the papers about it) is that the current GC is well liked by the OTP guys because it is extremely fast - much faster than the equivalent generational version. The trade off of not having "under the hood" destructive updates appears to be a pretty good one. This is partly what lay behind my suggestion to simply use a heap based destructive update mechanism like ets which has no GC. Also once one introduces another way of doing imperative programming into the language it has the potential to lead to more imperative style side effect bugs ;) I'm thinking particularly about exception handling where the result of the function call depends on whether the function crashed before or after the array operation. Erlang programmers have (presumably) got used to dealing with this situation using ets so having something with the same type of library API and general usage pattern might help somewhat to overcome the weaknesses in the imperative nature. Your version would overcome this (i.e. you still provide access to the old version) but at the expense of more GC complexity.. > What were the advantages: > > - Very useful, in short :-) For HIPE, graph algorithms became much > more pleasant. I also implemented hash tables on top of the arrays, > which rapidly spread through the compiler. Many common algorithms > are much easier to write when your array ADT has the right > complexity. Would you include the declarative bit in the "right complexity"? > I know there has been discussions about implementing something like > this in OTP, but I don't know the precise status. Bj?rn G. probably > knows more :-) I hope so.. but not at the expense of overall system performance. Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Sean.Hinde@REDACTED Wed May 2 12:50:51 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Wed, 2 May 2001 11:50:51 +0100 Subject: Heap based mutable arrays? Message-ID: <402DD461F109D411977E0008C791C312039F5F4D@imp02mbx.one2one.co.uk> > > I bypass the garbage collection problem by forcing a > fullsweep collection > > as soon as any vector is updated. /.../ How about bypassing the garbage collector by copying the data into the array a la ets and using some sort of occasional tidyup routine to fix any fragmentation you get? In the case where you are storing the same sized element into the array each time the overhead would be directly proportional to the size of the data stored with no need to ever tidy up. The vector version does look to be ultimately much better I agree - assuming the GC can be fixed up without breaking the overall performance. Maybe there is space for both? Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From thomasl@REDACTED Wed May 2 16:47:10 2001 From: thomasl@REDACTED (Thomas Lindgren) Date: Wed, 2 May 2001 13:47:10 -0100 Subject: Heap based mutable arrays? In-Reply-To: <402DD461F109D411977E0008C791C312039F5F4C@imp02mbx.one2one.co.uk> (message from Sean Hinde on Wed, 2 May 2001 11:38:47 +0100) References: <402DD461F109D411977E0008C791C312039F5F4C@imp02mbx.one2one.co.uk> Message-ID: <200105021447.f42ElAC20700@lammgam.bluetail.com> > Would you include the declarative bit in the "right complexity"? Well, the point was just that you can translate an existing imperative algorithm fairly easily (if verbosely) into Erlang _and_ get good complexity. You can do the translation part today with an appropriate ADT: /* A[I] = A[M]+A[N] */ ... V1 = read(Array0,M), V2 = read(Array0,N), Array1 = write(Array0,I,M+N), %% now use Array1 from here on ... But space/time complexity will of course depend on how read/2 and write/3 are implemented. Getting the right complexity for both reads and writes is the problem solved by declarative vectors. The complexity of implementing the algorithm stays about the same, though debugging may be easier since old versions can be kept around for inspection. (Having a verbose notation for array access may make implementation harder, due to syntactic clutter; erl_lint could perhaps be extended to warn about bad use of old versions.) Thomas -- Thomas Lindgren thomas+junk@REDACTED Alteon WebSystems From nick@REDACTED Wed May 2 14:02:38 2001 From: nick@REDACTED (Niclas Eklund) Date: Wed, 2 May 2001 14:02:38 +0200 (MET DST) Subject: Problem setting DefaultQoS with Notification Service In-Reply-To: Message-ID: On Mon, 30 Apr 2001, Jani Launonen wrote: > Hello everyone, > previously I had problems setting QoS-parametres - that is now passed. > After trying to circumvent the problem by using java to call > EventChannelFactory:create_channel (which didn't succeed by some weird > problem with JacORB's idl-compiler), I used cut & paste -method from the > sources and after reading little bit manuals and tutorials I could > construct a kind of working record which was accepted by > EventChannelFactory:create_channel. Jesh! There only seems to be problem > with JacORB's understanding of IORs with "wstring inside Anys" - even after > a patch to recent JacORB 1.3.21. This is off topic but just to tell the > status that no one is going to bother with the previous problem. > > >[cut introduction] > > > >There's an example use of Notification Service at page > >http://www.erlang.org/doc/r7b/lib/cosNotification-1.0.2/doc/html/ch_example.html#7.1 > >which has this code: > > > > %% Create a new event channel. > > Ch = 'CosNotifyChannelAdmin_EventChannelFactory': > > create_channel(ChFac, DefaultQoS, DefaultAdmin), > > > >The question is, whether there is these DefaultQoS and DefaultAdmin > >defined somewhere or are these just put as an place holders here? Or is > >there a way to create channel with default QoS/Admin values by some other > >function? Page > >http://www.erlang.org/doc/r7b/lib/cosNotification-1.0.2/doc/html/ch_QoS.html#6 > >does say, what the default values are, so these must be hidden somewhere in > >the source. I've tried to find out this DefaultQoS (DefaultAdmin) (or > >similar) in the source, but failed so far. Could someone help me with this > >one as I'm bit confused with the record syntax in Erlang (and especially > >those Corba mappings) and haven't succeeded creating default values by myself. Hello! In the User's Guide (6.1.1) you find a listing of the default QoS-service settings and the range of each key. If you do not include a certain key when creating a new channel these will be used and inherited by its children and grand-children (i.e. Admin's and Proxies). To be able to help you with your problem regarding the wstrings I need to know which Orber-version you're using. I've tested sending wchar/wstring encapsulated within an any-datatype using VisiBroker. Orber have also been tested using JacORB (I do not know if wchar/wstrings have been included in these tests). FYI, sending a wstring is more expensive than string's since each wchar is encoded/decoded as ushort due to that Orber only support Java Unicode for wchars; CORBA wchar can range from 1 to 4 bytes. Regards / Nick _____________________________________________________________ Niclas Eklund, Ericsson Network Core Products, +46-8-72 75765 From etxuwig@REDACTED Wed May 2 14:09:31 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 2 May 2001 14:09:31 +0200 (MET DST) Subject: Heap based mutable arrays? In-Reply-To: <200105021447.f42ElAC20700@lammgam.bluetail.com> Message-ID: On Wed, 2 May 2001, Thomas Lindgren wrote: >erl_lint could perhaps be extended to warn about bad use of old >versions.) This issue was subject to some "heated" debate (that is to say, we didn't agree on very much) on the erlang list in November: http://www.erlang.org/ml-archive/erlang-questions/200011/msg00031.html Just thought I'd mention it, so we don't have to repeat all the arguments again... (: /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From jabba@REDACTED Wed May 2 22:17:21 2001 From: jabba@REDACTED (Jani Launonen) Date: Wed, 2 May 2001 23:17:21 +0300 (EEST) Subject: Problem setting DefaultQoS with Notification Service In-Reply-To: Message-ID: On Wed, 2 May 2001, Niclas Eklund wrote: >On Mon, 30 Apr 2001, Jani Launonen wrote: >> [cut description of ior problem with JacORB] >> [cut description of original problem] > >Hello! > >In the User's Guide (6.1.1) you find a listing of the default QoS-service >settings and the range of each key. If you do not include a certain key >when creating a new channel these will be used and inherited by its >children and grand-children (i.e. Admin's and Proxies). Cripes!? So the default values can be used by calling create_channel with empty lists as arguments to QoS-settings?! And I thought that I had tried that out already. Apparently not. Maybe this should be spelled out somewhere in the Guide for novices like me :-). Well, on the positive side, I should have learned the records syntax anyway in the near future. >To be able to help you with your problem regarding the wstrings I need to >know which Orber-version you're using. I've tested sending wchar/wstring >encapsulated within an any-datatype using VisiBroker. Orber have also been >tested using JacORB (I do not know if wchar/wstrings have been included >in these tests). FYI, sending a wstring is more expensive than string's >since each wchar is encoded/decoded as ushort due to that Orber only >support Java Unicode for wchars; CORBA wchar can range from 1 to 4 bytes. Orber version is 3.2.2. Frankly, I don't know for sure, that the wstrings are to blame, but Mr. Bj?rn Wingman have encountered the same problem ( http://lists.spline.inf.fu-berlin.de/mailman/htdig/jacorb-developer/2001-February/001539.html ). Before I applied the fix for JacORB 1.3.21 fix for TypeCode ( http://jacorb.inf.fu-berlin.de/problemscontents.html ) the symptoms were the same as Bj?rn had. After the patch, dior (dump ior) reports little bit different problem. Here's what the dior has to say about channel's ior: JacORB V 1.3.21, www.jacorb.org (C) Gerald Brose, FU Berlin, 28 March 2001 ------IOR components----- TypeId : IDL:omg.org/CosNotifyChannelAdmin/EventChannel:1.0 TAG_INTERNET_IOP Profiles: Profile Id : IIOP Version : 1.1 Host : 130.231.48.51 Port : 4001 Object key (hex): 0x4F 52 42 45 52 83 68 06 6D 00 00 00 32 49 44 4C 3A 6F 6D 67 2E 6F 72 67 2F 43 6F 73 4E 6F 74 69 66 79 43 68 61 6E 6E 65 6C 41 64 6D 69 6E 2F 45 76 65 6E 74 43 68 61 6E 6E 65 6C 3A 31 2E 30 64 00 03 6B 65 79 6D 00 00 00 25 83 68 02 68 03 62 00 00 03 DC 62 00 0C A2 89 62 00 01 02 BA 64 00 0E 61 40 74 6B 31 31 2E 6F 75 6C 75 2E 66 69 6D 00 00 00 0D 83 64 00 09 75 6E 64 65 66 69 6E 65 64 6D 00 00 00 0D 83 64 00 09 75 6E 64 65 66 69 6E 65 64 6D 00 00 00 0D 83 64 00 09 75 6E 64 65 66 69 6E 65 64 TAG_MULTIPLE_COMPONENTS Profiles: CodeSet Component Info: ForChar native code set Id: ISO8859_1 Char Conversion Code Sets: ForWChar native code set Id: Unknown TCS: 3e8 WChar Conversion Code Sets: So it seems that something is still wrong with the wstrings? I haven't had chance to try decode this ior with anything else besides JacORB's dior. Could there still be problem with JacORB or is the ior corrupted by Orber? Here's the ior just for sure, if you want to try it for yourself: IOR:000303030000003349444c3a6f6d672e6f72672f436f734e6f746966794368616e6e656c41646d696e2f4576656e744368616e6e656c3a312e3000010000000200000000000000c8000101010000000e3133302e3233312e34382e3531000fa1000000a54f524245528368066d0000003249444c3a6f6d672e6f72672f436f734e6f746966794368616e6e656c41646d696e2f4576656e744368616e6e656c3a312e306400036b65796d00000025836802680362000003dc62000ca28962000102ba64000e6140746b31312e6f756c752e66696d0000000d83640009756e646566696e65646d0000000d83640009756e646566696e65646d0000000d83640009756e646566696e656403030300000000000000010000002400030303000000010000000100000014000303030001000100000000000003e800000000 >Regards / Nick > >_____________________________________________________________ >Niclas Eklund, Ericsson Network Core Products, +46-8-72 75765 Cheers, -+-+-+- Jani Launonen Home: (08) 8802 180/Work: +358 8 553 2810 jabba@REDACTED Paalikatu 14 A 410 90520 OULU Student. . . . . . . . . .University of Oulu, Dept. of EE Assistant Researcher . . .Genie of the Net Project From nick@REDACTED Thu May 3 12:54:47 2001 From: nick@REDACTED (Niclas Eklund) Date: Thu, 3 May 2001 12:54:47 +0200 (MET DST) Subject: Problem setting DefaultQoS with Notification Service In-Reply-To: Message-ID: On Wed, 2 May 2001, Jani Launonen wrote: > [cut plenty] > Orber version is 3.2.2. Frankly, I don't know for sure, that the wstrings > are to blame, but Mr. Bj?rn Wingman have encountered the same problem ( > http://lists.spline.inf.fu-berlin.de/mailman/htdig/jacorb-developer/2001-February/001539.html > ). Before I applied the fix for JacORB 1.3.21 fix for TypeCode ( > http://jacorb.inf.fu-berlin.de/problemscontents.html ) the symptoms were > the same as Bj?rn had. After the patch, dior (dump ior) reports little bit > different problem. Here's what the dior has to say about channel's ior: I assume the result is a INV_OBJREF exception?! The Code Set Id have been changed (Orber-3.2.3). Update to: orber_iiop.hrl: -define(ISO_10646_UCS_2_ID, 16#00010100). Now it should work. Regards / Nick > JacORB V 1.3.21, www.jacorb.org > (C) Gerald Brose, FU Berlin, 28 March 2001 > ------IOR components----- > TypeId : IDL:omg.org/CosNotifyChannelAdmin/EventChannel:1.0 > TAG_INTERNET_IOP Profiles: > Profile Id : IIOP Version : 1.1 > Host : 130.231.48.51 > Port : 4001 > Object key (hex): 0x4F 52 42 45 52 83 68 06 6D 00 00 00 32 49 44 > 4C 3A 6F 6D 67 2E 6F 72 67 2F 43 6F 73 4E 6F 74 69 66 79 43 68 61 6E 6E 65 > 6C 41 64 6D 69 6E 2F 45 76 65 6E 74 43 68 61 6E 6E 65 6C 3A 31 2E 30 64 00 > 03 6B 65 79 6D 00 00 00 25 83 68 02 68 03 62 00 00 03 DC 62 00 0C A2 89 62 > 00 01 02 BA 64 00 0E 61 40 74 6B 31 31 2E 6F 75 6C 75 2E 66 69 6D 00 00 00 > 0D 83 64 00 09 75 6E 64 65 66 69 6E 65 64 6D 00 00 00 0D 83 64 00 09 75 6E > 64 65 66 69 6E 65 64 6D 00 00 00 0D 83 64 00 09 75 6E 64 65 66 69 6E 65 64 > TAG_MULTIPLE_COMPONENTS Profiles: > CodeSet Component Info: > ForChar native code set Id: ISO8859_1 > Char Conversion Code Sets: ForWChar native > code set Id: Unknown TCS: 3e8 > WChar Conversion Code Sets: > > So it seems that something is still wrong with the wstrings? I haven't had > chance to try decode this ior with anything else besides JacORB's dior. > Could there still be problem with JacORB or is the ior corrupted by Orber? > Here's the ior just for sure, if you want to try it for yourself: _____________________________________________________________ Niclas Eklund, Ericsson Network Core Products, +46-8-72 75765 From jabba@REDACTED Thu May 3 15:21:55 2001 From: jabba@REDACTED (Jani Launonen) Date: Thu, 3 May 2001 16:21:55 +0300 (EEST) Subject: Problem setting DefaultQoS with Notification Service In-Reply-To: Message-ID: On Thu, 3 May 2001, Niclas Eklund wrote: >> [cut cut cut] > >I assume the result is a INV_OBJREF exception?! >The Code Set Id have been changed (Orber-3.2.3). Update to: >orber_iiop.hrl: -define(ISO_10646_UCS_2_ID, 16#00010100). You're absolutely right. Any JacORB client trying to make contact with the event channel, throws org.omg.CORBA.UNKNOWN: NV_OBJREF. Unfortynately the fix didn't do the trick - I compiled the whole otp R7B-2 with this update to orber_iiop.hrl, but the problem persists. Only this time the dior reports bit differently: "... ForChar native code set Id: ISO8859_1 Char Conversion Code Sets: ForWChar native code set Id: Unknown TCS: 10100 WChar Conversion Code Sets: " instead of "... > ForChar native code set Id: ISO8859_1 > Char Conversion Code Sets: ForWChar native > code set Id: Unknown TCS: 3e8 > WChar Conversion Code Sets: " Maybe the whole orber should be replaced with newer one? >Niclas Eklund, Ericsson Network Core Products, +46-8-72 75765 > > -+-+-+- Jani Launonen Home: (08) 8802 180/Work: +358 8 553 2810 jabba@REDACTED Paalikatu 14 A 410 90520 OULU Student. . . . . . . . . .University of Oulu, Dept. of EE Assistant Researcher . . .Genie of the Net Project From jamesh@REDACTED Thu May 3 18:36:47 2001 From: jamesh@REDACTED (James Hague) Date: Thu, 3 May 2001 11:36:47 -0500 Subject: Heap based mutable arrays? Message-ID: Sean Hinde wrote: > > We hear that supporting automatically mutable > tuples is not possible due to > the nature of the current garbage collector - > in R8 there is an optimisation > for multiple updates in one go within a record > but it still gets copied. Where is this information about R8 coming from :) I'm curious to know what's planned. James From Sean.Hinde@REDACTED Thu May 3 18:54:32 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Thu, 3 May 2001 17:54:32 +0100 Subject: Heap based mutable arrays? Message-ID: <402DD461F109D411977E0008C791C312039F5F53@imp02mbx.one2one.co.uk> > Sean Hinde wrote: > > > > We hear that supporting automatically mutable > > tuples is not possible due to > > the nature of the current garbage collector - > > in R8 there is an optimisation > > for multiple updates in one go within a record > > but it still gets copied. > > Where is this information about R8 coming from :) I based this on an e-mail sent to the mailing list http://www.erlang.org/ml-archive/erlang-questions/200010/msg00112.html > I'm curious to know what's planned. Me too :) Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From kostis@REDACTED Thu May 3 19:51:40 2001 From: kostis@REDACTED (Kostis Sagonas) Date: Thu, 3 May 2001 19:51:40 +0200 (MET DST) Subject: Concurrent benchmark programs Message-ID: <200105031751.TAA04700@audrey.it.uu.se> We, some members of the HiPE group, are currently in the process of investigating various alternative heap architectures for concurrent programs, with emphasis (sic!) on Erlang ones. Among these architectures, are the current R7B-* one (each heap has its own process) and a "unified" (i.e., common) heap architecture for all processes, but also other variations either in the heap organization or in the GC scheme employed. (Yes, I know the issue has been discussed in this list before, but since I am willing to bet that it is bound to be discussed again, we want to investigate it and provide a definite answer and detailed performance results that will shed light to the pros and cons of each scheme and will result in a long document which hopefully not appear only in the FAQ of this list ;-). Anyway, this mail is a request/plea for "interesting" (and preferably "real-life") concurrent programs that can be used for benchmarks by us. Any sort of "interesting" benchmark that involves a significant amount of interprocess communication will do, and we will even let you decide what "interesting" really means there. Minimally, we would like programs that have been used as benchmarks before in a similar task (Robert, this is for you). If you wish, we are willing to sign any sort of NDAs for the code we get. Also, we give you our word that we are going to try to not even look at your code (let alone understand it :-) if we do not necessarily have to! In return, we promise to: - add your name to the acknowledgement section of the above mentioned document if we end up using your program as benchmark, and more importantantly, - try to incorporate the "winner" configuration to some future Erlang/OTP release so that your favourite programs run faster. All the best, Kostis Sagonas (for the HiPE group). From vances@REDACTED Fri May 4 03:56:14 2001 From: vances@REDACTED (Vance Shipley) Date: Thu, 3 May 2001 21:56:14 -0400 Subject: HAVE_UIO_H vs. HAVE_SYS_UIO_H Message-ID: I believe there is a small problem with the the configuration defines for the uio.h header. On my Linux system I have a and my config.h contains: #define HAVE_SYS_UIO_H 1 This is good. However there seems to be some an old use of HAVE_UIO_H that remains in the some files. Specifically I'm looking at erl_driver.h and I see the following: ./erts/emulator/beam/erl_driver.h: #if defined(VXWORKS) # include typedef struct iovec SysIOVec; #elif defined(__WIN32__) /* * This structure can be cast to a WSABUF structure. */ typedef struct _SysIOVec { unsigned long iov_len; char* iov_base; } SysIOVec; #else /* Unix */ # ifdef HAVE_UIO_H # include typedef struct iovec SysIOVec; # else typedef struct { char* iov_base; int iov_len; } SysIOVec; # endif #endif So the systems own definition for iovec does not get used as HAVE_UIO_H is not defined. I believe this should be changed to: #else /* Unix */ --- # ifdef HAVE_UIO_H +++ # ifdef HAVE_SYS_UIO_H # include That would have a different definition here as my definition is ( includes to pull in the definition for iovec): /usr/include/bit/uio.h: /* Structure for scatter/gather I/O. */ struct iovec { void *iov_base; /* Pointer to data. */ size_t iov_len; /* Length of data. */ }; I see that inet_drv.c already has the updated HAVE_SYS_UIO_H. Some other files also have the old version. The following is what I turned up on my R7B-1 system: ./erts/autoconf/acconfig.h: #undef HAVE_UIO_H ./erts/autoconf/config.h.in: #undef HAVE_SYS_UIO_H ./erts/autoconf/i686-pc-linux-gnu/config.status: ${ac_dA}HAVE_SYS_UIO_H${ac_dB}HAVE_SYS_UIO_H${ac_dC}1${ac_dD} ${ac_uA}HAVE_SYS_UIO_H${ac_uB}HAVE_SYS_UIO_H${ac_uC}1${ac_uD} ${ac_eA}HAVE_SYS_UIO_H${ac_eB}HAVE_SYS_UIO_H${ac_eC}1${ac_eD} ./erts/autoconf/i686-pc-linux-gnu/config.h: #define HAVE_SYS_UIO_H 1 ./erts/emulator/beam/erl_driver.h: # ifdef HAVE_UIO_H ./erts/emulator/drivers/common/inet_drv.c: #ifdef HAVE_SYS_UIO_H ./erts/emulator/sys/unix/driver_int.h: #ifdef HAVE_UIO_H ./lib/kernel/examples/uds_dist/c_src/uds_drv.c: #define HAVE_UIO_H -Vance Vance Shipley Motivity Telecom Inc. +1 519 579 5816 From qmatben@REDACTED Fri May 4 11:10:09 2001 From: qmatben@REDACTED (Mats Bengtsson) Date: Fri, 4 May 2001 11:10:09 +0200 (MET DST) Subject: os_mon does not work for Linux Message-ID: <200105040910.LAA01356@tb14110.tn.etx.ericsson.se> Hi, os_mon is not working for Linux. This applies for both os_mon-1.3.8 and os_mon-1.3.8.1 I haven't checked the other versions. There is no case for Linux in disksup.erl SunOS and Win32 is there but not Linux. The same thing seems to apply for memsup.erl I'm currently using Red Hat 7.1 Does someone now about this problem or has fixed it? /Mats Bengtsson From etxuwig@REDACTED Fri May 4 11:40:01 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Fri, 4 May 2001 11:40:01 +0200 (MET DST) Subject: os_mon does not work for Linux In-Reply-To: <200105040910.LAA01356@tb14110.tn.etx.ericsson.se> Message-ID: On Fri, 4 May 2001, Mats Bengtsson wrote: >Hi, >os_mon is not working for Linux. >This applies for both os_mon-1.3.8 and os_mon-1.3.8.1 >I haven't checked the other versions. I believe os_mon support for different platforms is implemented on a per-need basis. Perhaps it's time for Linux now? A good Open Source programming exercise... ;) /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From tab@REDACTED Fri May 4 12:44:04 2001 From: tab@REDACTED (Tomas Abrahamsson) Date: Fri, 4 May 2001 12:44:04 +0200 (MET DST) Subject: reshd Message-ID: <200105041044.MAA02198@sally.lysator.liu.se> Here's a small program, that provides a telnet interface to the erlang shell. I called it reshd, which is short for remote erlang shell daemon. It is an alternative to run_erl/to_erl. It opens a tcp/ip port and listens for incoming connections. Any connection to this port drops right into an erlang shell. Example: First I make the erlang node execute reshd:start(5000). Then from a unix shell: prompt% telnet localhost 5000 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Eshell V5.0.1 (node@REDACTED)1> io:format("Hello!~n"). Hello! ok (node@REDACTED)2> l(my_module). {module,my_module} (node@REDACTED)3> exit(). ** Terminating shell ** Connection closed by foreign host. prompt% The following is attached: - reshd.erl -- the remote erlang shell daemon. - resh.el -- emacs extensions to the erlang mode, for connecting to a reshd. It offers the keybinding C-c s, which sets the resh-buffer as current compilation-buffer. No efforts have been made regarding security, but I guess it would be easy to add ssl and password authentication or whatever is needed. /Tomas -------------- next part -------------- %%%---------------------------------------------------------------------- %%% Purpose : Remote erlang shell daemon -- a telnet interface to the shell %%% File : reshd.erl %%% Author : Tomas Abrahamsson %%% Created : 12 Apr 2001 by Tomas Abrahamsson %%% %%% COPYRIGHT %%% %%% These programs are released into the public domain. You may do %%% anything you like with them, including modifying them and selling %%% the binaries without source for ridiculous amounts of money without %%% saying who made them originally. %%% %%% However, I would be happy if you release your works with complete %%% source for free use. %%%---------------------------------------------------------------------- -module(reshd). -author('tab@REDACTED'). -rcs('$Id: reshd.erl,v 1.5 2001/05/04 09:57:48 tab Exp $'). % ' %% API -export([start/1, start/2]). -export([stop/1, stop/2]). -export([build_regname/1, build_regname/2]). %% exports due to spawns -export([server_init/3]). -export([clienthandler_init/3]). %% ---------------------------------------------------------------------- %% ---------------------------------------------------------------------- %% API %% ---------------------------------------------------------------------- %% ---------------------------------------------------------------------- %% ---------------------------------------------------------------------- %% start(PortNumber) -> {ok, UsedPortNumber} | {error, Reason} %% start(IP, PortNumber) -> {ok, UsedPortNumber} | {error, Reason} %% Portnumber = UsedPortNumber = integer(0..65535) %% IP = any | {Byte,Byte,Byte,Byte} %% Byte = integer(0..255) %% %% Start the reshd server to listen for connections on TCP/IP port PortNumber. %% %% The special port number 0 means "use any available TCP/IP port". %% The port that is actually used is returned. If PortNumber != 0, then %% UsedPortNumber == PortNumber. %% %% Optionally, an IP address to bind to can also be specified. %% The default is that IP any, which means to bind to all ip addresses %% on the machine. %% %% The process that listens for and handles incoming connections is %% locally registred under the name reshd__. %% build_regname is used to build the name. %% ---------------------------------------------------------------------- start(PortNumber) -> start(any, PortNumber). start(IP, PortNumber) -> server_start(IP, PortNumber). %% ---------------------------------------------------------------------- %% stop(PortNumber) -> void() %% stop(IP, PortNumber) -> void() %% Portnumber = UsedPortNumber = integer(0..65535) %% IP = any | {Byte,Byte,Byte,Byte} %% Byte = integer(0..255) %% %% Stops the reshd server and any open connections associated to it. %% ---------------------------------------------------------------------- stop(PortNumber) -> stop(any, PortNumber). stop(IP, PortNumber) -> server_stop(IP, PortNumber). %% ---------------------------------------------------------------------- %% build_regname(PortNumber) -> atom() %% build_regname(IP, PortNumber) -> atom() %% Portnumber = UsedPortNumber = integer(0..65535) %% IP = any | {Byte,Byte,Byte,Byte} %% Byte = integer(0..255) %% %% Build a name under which the reshd server may be registered. %% ---------------------------------------------------------------------- build_regname(PortNumber) -> build_regname(any, PortNumber). build_regname(any, PortNumber) -> Name = atom_to_list(?MODULE) ++ "_any_" ++ integer_to_list(PortNumber), list_to_atom(Name); build_regname({IP1, IP2, IP3, IP4}, PortNumber) -> Name = atom_to_list(?MODULE) ++ "_" ++ list_to_integer(IP1) ++ "_" ++ list_to_integer(IP2) ++ "_" ++ list_to_integer(IP3) ++ "_" ++ list_to_integer(IP4) ++ "_" ++ "_" ++ integer_to_list(PortNumber), list_to_atom(Name); build_regname(HostNameOrIP, PortNumber) -> Name = atom_to_list(?MODULE) ++ "_" ++ HostNameOrIP ++ "_" ++ integer_to_list(PortNumber), list_to_atom(Name). %% ---------------------------------------------------------------------- %% ---------------------------------------------------------------------- %% Internal functions: the server part %% ---------------------------------------------------------------------- %% ---------------------------------------------------------------------- server_start(IP, PortNumber) -> Server = spawn(?MODULE, server_init, [self(), IP, PortNumber]), receive {ok, UsedPortNumber} -> RegName = build_regname(IP, UsedPortNumber), register(RegName, Server), {ok, UsedPortNumber}; {error, {Symptom, Diagnostics}} -> {error, {Symptom, Diagnostics}} end. server_stop(IP, PortNumber) -> RegName = build_regname(IP, PortNumber), case whereis(RegName) of undefined -> do_nothing; Pid -> Pid ! stop end. server_init(From, IP, PortNumber) -> IPOpt = ip_to_opt(IP), ListenOpts = [list, {packet, 0}, {active, true}, % this is the default {nodelay, true}, {reuseaddr, true}] ++ IPOpt, case gen_tcp:listen(PortNumber, ListenOpts) of {ok, ServerSocket} -> {ok, UsedPortNumber} = inet:port(ServerSocket), From ! {ok, UsedPortNumber}, process_flag(trap_exit, true), server_loop(From, ServerSocket); {error, Reason} -> From ! {error, {listen_failed, Reason}} end. ip_to_opt(any) -> []; ip_to_opt({IP1, IP2, IP3, IP4}=IPNumber) -> [{ip, IPNumber}]; ip_to_opt(HostNameOrIPAsString) -> case inet:getaddr(HostNameOrIPAsString, inet) of {ok, IPNumber} -> [{ip, IPNumber}]; {error, Error} -> loginfo("~p: IP lookup failed for ~p: ~p. Binding to any ip.", [?MODULE, HostNameOrIPAsString, Error]), [] end. server_loop(From, ServerSocket) -> server_loop(From, ServerSocket, []). server_loop(From, ServerSocket, Clients) -> case gen_tcp:accept(ServerSocket, 250) of {ok, ClientSocket} -> ClientHandler = clienthandler_start(From, self(), ClientSocket), gen_tcp:controlling_process(ClientSocket, ClientHandler), server_loop(From, ServerSocket, [ClientHandler | Clients]); {error, timeout} -> %% Check for signals now and then receive stop -> lists:foreach(fun(Client) -> Client ! stop end, Clients), done; {client_stop, Client} -> RemainingClients = [C || C <- Clients, C /= Client], server_loop(From, ServerSocket, RemainingClients); {'EXIT', Client, Reason} -> RemainingClients = [C || C <- Clients, C /= Client], server_loop(From, ServerSocket, RemainingClients); Unexpected -> loginfo("~p:server_loop: unexpected message:~p", [?MODULE, Unexpected]), server_loop(From, ServerSocket, Clients) after 0 -> server_loop(From, ServerSocket, Clients) end; {error, Reason} -> logerror("~p:server_loop: Error: accepting on ~p: ~p.", [?MODULE, ServerSocket, Reason]) end. %% ---------------------------------------------------------------------- %% ---------------------------------------------------------------------- %% The client handler part -- handles a user of the reshd. %% ---------------------------------------------------------------------- %% ---------------------------------------------------------------------- clienthandler_start(From, Server, ClientSocket) -> spawn_link(?MODULE, clienthandler_init, [From, Server, ClientSocket]). -record(io_request, { prompt, mod, fn, args, from, reply_as }). clienthandler_init(From, Server, ClientSocket) -> %% Announce ourself as group leader. %% This causes all calls to io:format(...) and such alike %% to send their output to us. group_leader(self(), self()), %% Next, start the shell %% and link to it, so we know when it exits. process_flag(trap_exit, true), Reshd = shell:start(true), link(Reshd), %% Go ahead and take care of user input! R = (catch clienthandler_loop(idle, Reshd, Server, ClientSocket)), exit(Reshd, kill). clienthandler_loop(State, Reshd, Server, ClientSocket) -> receive {tcp, _Socket, Input} -> NativeInput = nl_network_to_native(Input), case handle_input(ClientSocket, State, NativeInput) of {ok, NewState} -> clienthandler_loop(NewState, Reshd, Server, ClientSocket); close -> gen_tcp:close(ClientSocket) end; {tcp_closed, Socket} -> Server ! {client_stop, self()}, done; {tcp_error, Socket, Reason} -> Server ! {client_stop, self()}, done; stop -> gen_tcp:close(ClientSocket), done; {io_request, From, ReplyAs, Req} -> case handle_io_request(ClientSocket, State, From, ReplyAs, Req) of {ok, NewState} -> clienthandler_loop(NewState, Reshd, Server, ClientSocket); close -> gen_tcp:close(ClientSocket) end; {'EXIT', Reshd, normal} -> gen_tcp:close(ClientSocket); {'EXIT', Reshd, _OtherReason} -> gen_tcp:close(ClientSocket); Other -> clienthandler_loop(State, Reshd, Server, ClientSocket) end. %% Returns: %% {ok, NewState} | %% close handle_input(ClientSocket, State, Input) -> case State of idle -> {ok, {pending_input, Input}}; {pending_input, PendingInput} -> NewInput = PendingInput ++ Input, {ok, {pending_input, NewInput}}; {pending_request, Cont, [FirstReq | RestReqs] = Requests} -> #io_request{prompt = Prompt, mod = Mod, fn = Fun, args = Args} = FirstReq, case catch apply(Mod, Fun, [Cont, Input|Args]) of {more, NewCont} -> print_prompt(ClientSocket, Prompt), {ok, {pending_request, NewCont, Requests}}; {done, Result, []} -> #io_request{from = From, reply_as = ReplyAs} = FirstReq, From ! {io_reply, ReplyAs, Result}, case length(RestReqs) of 0 -> {ok, idle}; N -> [#io_request{prompt = NextPrompt}|_] = RestReqs, print_prompt(ClientSocket, NextPrompt), InitCont = init_cont(), {ok, {pending_request, InitCont, RestReqs}} end; {done, Result, RestChars} -> #io_request{from = From, reply_as = ReplyAs} = FirstReq, From ! {io_reply, ReplyAs, Result}, case length(RestReqs) of 0 -> {ok, {pending_input, RestChars}}; N -> InitCont = init_cont(), TmpState = {pending_request, InitCont, RestReqs}, handle_input(ClientSocket, RestChars, TmpState) end; Other -> logerror("~p:handle_input: Unexpected result: ~p~n", [?MODULE, Other]), close end end. %% Returns: %% {ok, NewState} | %% close handle_io_request(ClientSocket, State, From, ReplyAs, IoRequest) -> case IoRequest of {put_chars, Mod, Fun, Args} -> Text = case catch apply(Mod, Fun, Args) of {'EXIT', Reason} -> ""; Txt -> Txt end, NWText = nl_native_to_network(lists:flatten(Text)), gen_tcp:send(ClientSocket, NWText), From ! {io_reply, ReplyAs, ok}, {ok, State}; {put_chars, Text} -> NWText = nl_native_to_network(lists:flatten(Text)), gen_tcp:send(ClientSocket, Text), From ! {io_reply, ReplyAs, ok}, {ok, State}; {get_until, Prompt, Mod, Fun, Args} -> NewReq = #io_request{prompt = Prompt, mod = Mod, fn = Fun, args = Args, from = From, reply_as = ReplyAs}, case State of {pending_request, Cont, PendingReqs} -> NewState = {pending_request, Cont, PendingReqs++[NewReq]}, {ok, NewState}; idle -> print_prompt(ClientSocket, Prompt), InitContinuation = init_cont(), NewState = {pending_request, InitContinuation, [NewReq]}, {ok, NewState}; {pending_input, Input} -> InitContinuation = init_cont(), TmpState = {pending_request, InitContinuation, [NewReq]}, handle_input(ClientSocket, TmpState, Input) end; UnexpectedIORequest -> loginfo("~p:handle_io_request: Unexpected IORequest:~p~n", [?MODULE, UnexpectedIORequest]), From ! {io_reply, ReplyAs, ok}, {ok, State} end. init_cont() -> []. print_prompt(ClientSocket, Prompt) -> PromptText = case Prompt of {IoFun, PromptFmtStr, PromptArgs} -> io_lib:IoFun(PromptFmtStr, PromptArgs); {IoFun, PromptFmtStr} -> io_lib:IoFun(PromptFmtStr, []) end, NWPromptText = nl_native_to_network(lists:flatten(PromptText)), gen_tcp:send(ClientSocket, NWPromptText). %% Convert network newline (cr,lf) to native (\n) nl_network_to_native(Input) -> nl_network_to_native(Input, ""). nl_network_to_native("\r\n" ++ Rest, Acc) -> nl_network_to_native(Rest, [$\n | Acc]); nl_network_to_native([C | Rest], Acc) -> nl_network_to_native(Rest, [C | Acc]); nl_network_to_native("", Acc) -> lists:reverse(Acc). %% Convert native newline \n to network (cr,lf) nl_native_to_network(Input) -> nl_native_to_network(Input, ""). nl_native_to_network("\n" ++ Rest, Acc) -> %% Here we put \r\n in reversed order. %% It'll be put in correct order by the lists:reverse() call %% in the last clause. nl_native_to_network(Rest, [$\n, $\r | Acc]); nl_native_to_network([C | Rest], Acc) -> nl_native_to_network(Rest, [C | Acc]); nl_native_to_network("", Acc) -> lists:reverse(Acc). loginfo(FmtStr, Args) -> %% FIXME: Invent a way to log errors. %% Can't use the error_log module since someone may %% add a log handler that does io:format. Then there %% will be a deadlock, I think, if this is function %% is called from within code that handles the client. fixme. logerror(FmtStr, Args) -> %% See loginfo/2. fixme. -------------- next part -------------- ;;; resh.el -- emacs support for connecting to a reshd ;;; (remote erlang shell daemon) ;; ;; $Id: resh.el,v 1.5 2001/05/04 09:57:34 tab Exp $ ;; ;; Author: Tomas Abrahamsson ;;; COPYRIGHT ;; These programs are released into the public domain. You may do ;; anything you like with them, including modifying them and selling ;; the binaries without source for ridiculous amounts of money without ;; saying who made them originally. ;; ;; However, I would be happy if you release your works with complete ;; source for free use. ;;; Installation: ;; Either: ;; ;; (autoload 'resh "resh" "Start a connection to an erlang reshd" t) ;; ;; or: ;; ;; (load-library "resh") ;; (resh-install) ; installs keymaps ;; ;; The difference is that in the second case, the resh is bound to ;; C-c c immediately, while in the first case no key bindings are ;; installed until you have typed M-x resh for the first time. ;;; Code (require 'erlang) ;; User definable variables ;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv (defvar resh-default-host "localhost" "*Default hostname for `resh'.") (defvar resh-default-port nil "*Default port (an integer) for `resh'.") ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ;; End of user definable variables (defvar resh-host-history nil "Host history for `resh'") (defvar resh-port-history nil "Port history for `resh'") (defvar resh-buff-history nil "Buffer name history for `resh'") (defvar resh-current-host nil "Buffer-local variable, used for reconnection.") (defvar resh-current-port nil "Buffer-local variable, used for reconnection.") (defvar resh-is-installed nil "Whether resh is installed or not") (defvar resh-auto-install-enabled t "Whether resh should autoinstall upon call to resh") ;;;###autoload (defun resh (host port &optional reconnecting wanted-buffer-name) "Run an inferior remote Erlang shell. The command line history can be accessed with M-p and M-n. The history is saved between sessions. Entry to this mode calls the functions in the variables `comint-mode-hook' and `erlang-shell-mode-hook' with no arguments. The following commands imitate the usual Unix interrupt and editing control characters: \\{erlang-shell-mode-map}" (interactive ;; Handling of interactive calling (let* ((init-prompt "Remote erlang shell to") (host-hist 'resh-host-history) (port-hist 'resh-port-history) (buff-hist 'resh-buff-history) (host-prompt (concat init-prompt ": ")) (remote-host (read-string host-prompt resh-default-host host-hist)) (port-prompt (concat init-prompt " " remote-host " port: ")) (default-port (cond ((null resh-default-port) nil) ((stringp resh-default-port) resh-default-port) ((numberp resh-default-port) (int-to-string resh-default-port)) (t nil))) (remote-port-str (read-string port-prompt default-port port-hist)) (remote-port (cond ((string= "" remote-port-str) (error "Not port number \"%s\"" remote-port-str)) (t (string-to-int remote-port-str)))) (buffer-prompt (concat init-prompt " " remote-host ":" remote-port-str ", buffer name: ")) (buffer-name (if current-prefix-arg (read-string buffer-prompt nil buff-hist) nil))) (list remote-host remote-port nil buffer-name))) (if (and (not resh-is-installed) resh-auto-install-enabled) (resh-install)) (require 'comint) (let* ((proc-name (resh-buffer-name inferior-erlang-process-name host port)) (erl-buffer (make-comint proc-name (cons host port))) (erl-process (get-buffer-process erl-buffer)) (erl-buffer-name (if wanted-buffer-name wanted-buffer-name (resh-buffer-name inferior-erlang-buffer-name host port)))) ;; Say no query needed if erl-process is running when Emacs is exited. (process-kill-without-query erl-process) ;; Switch to buffer in other or this window ;; the `erlang-inferior-shell-split-window' is a local extension ;; to the erlang mode. (if (and (boundp 'erlang-inferior-shell-split-window) erlang-inferior-shell-split-window) (switch-to-buffer-other-window erl-buffer) (switch-to-buffer erl-buffer)) ;; comint settings (if (and (not (eq system-type 'windows-nt)) (eq inferior-erlang-shell-type 'newshell)) (setq comint-process-echoes nil)) ;; Set buffer name and run erlang-shell-mode unless we are reconnecting (if reconnecting nil (condition-case nil ;; `rename-buffer' takes only one argument in Emacs 18. (rename-buffer erl-buffer-name t) (error (rename-buffer erl-buffer-name))) ;; remember the host/port so we can reconnect. (make-variable-buffer-local 'resh-current-host) (make-variable-buffer-local 'resh-current-port) (setq resh-current-host host) (setq resh-current-port port) (erlang-shell-mode)))) (defun resh-buffer-name (base host port) (let* ((host-port (concat host ":" (int-to-string port)))) (if (string= (substring base -1) "*") (concat (substring base 0 -1) "-" host-port "*") (concat base "-" host-port)))) (defun resh-reconnect () "Try to reconnect to a remote Erlang shell daemon." (interactive) (resh resh-current-host resh-current-port t)) (defun resh-set-inferior-erlang-buffer () "Set current buffer to the inferior erlang buffer." (interactive) (setq inferior-erlang-buffer (current-buffer)) (message "This buffer is now set to the current inferior erlang buffer")) ;;;###autoload (defun resh-install () (interactive) (if (not resh-is-installed) (progn (if (not (member 'resh-install-erl-keys erlang-mode-hook)) (add-hook 'erlang-mode-hook 'resh-install-erl-keys)) (if (not (member 'resh-install-erl-shell-keys erlang-shell-mode-hook)) (add-hook 'erlang-shell-mode-hook 'resh-install-erl-shell-keys)) (setq resh-is-installed t)))) (defun resh-install-erl-keys () (local-set-key "\C-cc" 'resh-erlang)) (defun resh-install-erl-shell-keys () (local-set-key "\C-cc" 'resh-erlang) (local-set-key "\C-cs" 'resh-set-inferior-erlang-buffer) ;; The reconnection is not fully working... ;;(local-set-key "\C-cr" 'resh-reconnect) ) (provide 'resh) From nick@REDACTED Fri May 4 15:20:18 2001 From: nick@REDACTED (Niclas Eklund) Date: Fri, 4 May 2001 15:20:18 +0200 (MET DST) Subject: Problem setting DefaultQoS with Notification Service In-Reply-To: Message-ID: On Thu, 3 May 2001, Jani Launonen wrote: > On Thu, 3 May 2001, Niclas Eklund wrote: > > [cut cut cut] > > > You're absolutely right. Any JacORB client trying to make contact with the > event channel, throws org.omg.CORBA.UNKNOWN: NV_OBJREF. Unfortynately the > fix didn't do the trick - I compiled the whole otp R7B-2 with this update > to orber_iiop.hrl, but the problem persists. The Id should be 16#00010109 (I missed the '9' in the end. Sorry). There are however two 'known problem' regarding wchars; you cannot use IIOP-1.2 and the CodeSet struct is missplaced (the OMG updated the spec and clearfied its location) in the IOR. The former "problem" on purpose. This wasn't a specific Orber problem since other ORB-vendors interpreted the initial spec in the same way. However, the spec states that if no CodeSet is found 16#00010109 should be used as fallback. > Maybe the whole orber should be replaced with newer one? Yes, it should be, especially since later versions comes with: * improved/faster Inter-ORB communication (IIOP) * less IFR register/unregister overhead (oe_register/oe_unregister) * a few fixes for IIOP-1.2 * all systems exceptions added to the documentation. * a new config variable orber_debug_level which makes it a lot easier to check what fails. Regards / Nick > -+-+-+- > Jani Launonen Home: (08) 8802 180/Work: +358 8 553 2810 > jabba@REDACTED Paalikatu 14 A 410 > 90520 OULU > Student. . . . . . . . . .University of Oulu, Dept. of EE > Assistant Researcher . . .Genie of the Net Project _____________________________________________________________ Niclas Eklund, Ericsson Network Core Products, +46-8-72 75765 From jdagefoerde@REDACTED Sun May 6 16:43:59 2001 From: jdagefoerde@REDACTED (=?iso-8859-1?Q? Jonas=20Dagef=F6rde ?=) Date: Sun, 6 May 2001 16:43:59 +0200 Subject: a simple question Message-ID: <200105061443.f46EhxW14102@mailgate3.cinetic.de> Dear Sir or Madam, I have simple and short problem: I start a module that only waits for input from the shell (with "In = io:read("input>")) and starts this function recursive after any input. But I get no input prompt on one computer and one input prompt and no more on the other computer, both are PCs running Windows 98. Is this a problem due to the current OTP-Release 5.0 R7B6 or is it just a simple fault of mine? Best regards Jonas Dagefoerde PS: I started working out a seminar about verification of erlang programs and wanted to try some examples and ideas... _______________________________________________________________________ 1.000.000 DM gewinnen - kostenlos tippen - http://millionenklick.web.de IhrName@REDACTED, 8MB Speicher, Verschluesselung - http://freemail.web.de From enano@REDACTED Mon May 7 22:05:44 2001 From: enano@REDACTED (Miguel Barreiro Paz) Date: Mon, 7 May 2001 22:05:44 +0200 (CEST) Subject: GPLed monet Message-ID: Hi, Some people have contacted me asking whether monet, a simple monitoring tool I presented last year at EUC 2000, was freely available. It wasn't, as it was developed under a closed contract, but I thought it would be nice to opensource it. I have started an open version mostly in spare time, and it's now available at http://www.lfcia.org/projects/monet . As you can read there, it's still far from complete, but should more or less work now. Right now it's mostly a framework based on MESH and EVA. Feel free to try it and flame me to death for code ugliness or bugs. Regards, Miguel From salcaraz@REDACTED Tue May 8 03:54:11 2001 From: salcaraz@REDACTED (Salvador Alcaraz) Date: Tue, 8 May 2001 03:54:11 +0200 (CEST) Subject: No subject In-Reply-To: Message-ID: Hello everybody, from Spain: This is my first time in the Erlang's Mails List. My questions is very simple: I need to get time system in Milisec. For example, function erlang:now() return {MegaSecs, Secs, MicroSecs}, but not Milisec. Can I use time Milisec with any Erlang's function??? The problem is that I am development a Packet Switching Network Simulator Tools, and I need to work with Milisec time unit. Thank you very much. Salva _________________________________________________ Salvador Alcaraz Carrasco Division de Ingenieria Telematica Dpto. de Fisica y Arquitectura de Computadores Universidad Miguel Hernandez salcaraz@REDACTED http://obelix.umh.es __________________________________________________ From salcaraz@REDACTED Tue May 8 04:23:42 2001 From: salcaraz@REDACTED (Salvador Alcaraz) Date: Tue, 8 May 2001 04:23:42 +0200 (CEST) Subject: Time in Milisecs In-Reply-To: Message-ID: Hello everybody, from Spain: This is my first time in the Erlang's Mails List. My questions is very simple: I need to get time system in Milisec. For example, function erlang:now() return {MegaSecs, Secs, MicroSecs}, but not Milisec. Can I use time Milisec with any Erlang's function??? The problem is that I am development a Packet Switching Network Simulator Tools, and I need to work with Milisec time unit. Thank you very much. Salva _________________________________________________ Salvador Alcaraz Carrasco Division de Ingenieria Telematica Dpto. de Fisica y Arquitectura de Computadores Universidad Miguel Hernandez salcaraz@REDACTED http://obelix.umh.es __________________________________________________ From matthias@REDACTED Tue May 8 08:52:13 2001 From: matthias@REDACTED (matthias@REDACTED) Date: Tue, 8 May 2001 08:52:13 +0200 (CEST) Subject: a simple question In-Reply-To: <200105061443.f46EhxW14102@mailgate3.cinetic.de> References: <200105061443.f46EhxW14102@mailgate3.cinetic.de> Message-ID: <15095.38813.266136.332846@corelatus.com> Hi, Jonas> I have simple and short problem: I start a module that only Jonas> waits for input from the shell (with "In = Jonas> io:read("input>")) and starts this function recursive after Jonas> any input. But I get no input prompt on one computer and Jonas> one input prompt and no more on the other computer, both Jonas> are PCs running Windows 98. Is this a problem due to the Jonas> current OTP-Release 5.0 R7B6 or is it just a simple fault Jonas> of mine? Specificially: Perhaps you're not entering a complete term, though that doesn't explain the difference between systems. I don't know of any such problem, but then again I don't use windows. In general: if you post a problem like this, you're more likely to get a good answer if you post - a short but complete module which demonstrates the problem. - a copy of the input/output showing the behaviour you saw Here's an example which does pretty much what I expect on my system: -module(jonas). -export([go/0]). go() -> {ok, In} = io:read('Input>'), ok = io:fwrite("got: ~p\n", [In]), go(). Running it on my R7B node: 8> c(jonas). {ok,jonas} 9> jonas:go(). Input>bla Input>. got: bla Input> Input>3. got: 3 I don't know why io:read treats its argument as a term rather than a string, but this isn't uncommon in older parts of the library. Maybe someone from Blutail/Alteon/Nortel can tell the story about the day Mr Term and Mr String had an argument and stopped being two sides of the same coin. ;-) Matthias From matthias@REDACTED Tue May 8 08:52:30 2001 From: matthias@REDACTED (matthias@REDACTED) Date: Tue, 8 May 2001 08:52:30 +0200 (CEST) Subject: Time in Milisecs In-Reply-To: References: Message-ID: <15095.38830.694992.457972@corelatus.com> > My questions is very simple: I need to get time system in Milisec. > > For example, function erlang:now() return {MegaSecs, Secs, MicroSecs}, but > not Milisec. If you have Megasecs, secs and microsecs, you can derive milliseconds from that, e.g. 1> MS = fun() -> {Mega, S, Micro} = now(), Mega * 1000000000 + S * 1000 + Micro div 1000 end. #Fun 2> MS(). 989303156877 3> MS(). 989303158117 This is not terribly efficient. > Can I use time Milisec with any Erlang's function??? In general, milliseconds are the unit of choice in erlang and its libraries. For instance, timeouts in receive statements are in milliseconds. Some exceptions are now() and timer:tc() > The problem is that I am development a Packet Switching Network Simulator > Tools, and I need to work with Milisec time unit. People often decouple simulators from real time, i.e. time elapsed in the simulation is not the same as time elapsed on your wall clock. Matthias From enano@REDACTED Tue May 8 19:39:52 2001 From: enano@REDACTED (Miguel Barreiro Paz) Date: Tue, 8 May 2001 19:39:52 +0200 (CEST) Subject: os_mon does not work for Linux In-Reply-To: Message-ID: Hi, > >os_mon is not working for Linux. > >This applies for both os_mon-1.3.8 and os_mon-1.3.8.1 > >I haven't checked the other versions. > > I believe os_mon support for different platforms is implemented on a > per-need basis. Perhaps it's time for Linux now? A good Open Source > programming exercise... ;) Here are the necessary patches. memsup, disksup and cpu_sup are ported, os_sup isn't (it isn't too documented either, and I haven't ever used it). It all seems to work correctly here under debian 2.2 (potato). No external ports, it parses /proc info instead. --- ../../os_mon_ORIX/src/cpu_sup.erl Mon Sep 20 23:11:36 1999 +++ cpu_sup.erl Tue May 8 19:21:59 2001 @@ -15,9 +15,11 @@ %% %% $Id$ %% +%% 20010508 linux support added +%% -module(cpu_sup). -%%% Purpose : Obtain cpu statistics on Solaris 2 +%%% Purpose : Obtain cpu statistics on Solaris 2 or Linux -export([nprocs/0,avg1/0,avg5/0,avg15/0,ping/0]). @@ -66,12 +68,17 @@ %% {stop, Reason} %%---------------------------------------------------------------------- init([]) -> - Prog = code:priv_dir(?APPLICATION) ++ ?PORT_PROG, - Port = open_port({spawn,Prog},[stream]), - if port(Port) -> - {ok, #state{port=Port}}; - true -> - {stop, {port_prog_not_available,Port}} + case os:type() of + {unix,sunos} -> + Prog = code:priv_dir(?APPLICATION) ++ ?PORT_PROG, + Port = open_port({spawn,Prog},[stream]), + if port(Port) -> + {ok, #state{port=Port}}; + true -> + {stop, {port_prog_not_available,Port}} + end; + {unix,linux} -> + {ok,#state{port=not_used}} end. %%---------------------------------------------------------------------- @@ -84,8 +91,13 @@ %% {stop, Reason, Reply, State} (terminate/2 is called) %%---------------------------------------------------------------------- handle_call(?quit, From, State) -> - State#state.port ! {self(), {command, ?quit}}, - State#state.port ! {self(), close}, + case os:type() of + {unix,sunos} -> + State#state.port ! {self(), {command, ?quit}}, + State#state.port ! {self(), close}; + _ -> + ok + end, {stop, shutdown, ok, State}; handle_call(Request, From, State) -> Reply = get_measurement(Request,State#state.port), @@ -124,11 +136,30 @@ %%%---------------------------------------------------------------------- get_measurement(Request,Port) -> - Port ! {self(), {command, Request}}, - receive - {Port,{data,[D3,D2,D1,D0]}} -> - (D3 bsl 24) bor (D2 bsl 16) bor (D1 bsl 8) bor D0 + case os:type() of + {unix,sunos} -> + Port ! {self(), {command, Request}}, + receive + {Port,{data,[D3,D2,D1,D0]}} -> + (D3 bsl 24) bor (D2 bsl 16) bor (D1 bsl 8) bor D0 + end; + {unix,linux} -> + {ok,F}=file:open("/proc/loadavg",[read,raw]), + {ok,D} = file:read(F,24), + {ok,[Load1,Load5,Load15,PRun,PTotal],_}=io_lib:fread("~f ~f ~f ~d/~d", D), + case Request of + ?avg1 -> sunify(Load1); + ?avg5 -> sunify(Load5); + ?avg15 -> sunify(Load15); + ?ping -> 4711; % Guys, it would be nice to document it somewhere ;) + ?nprocs -> PTotal + end + end. + +sunify(Val) -> + round(Val*256). % Note that Solaris and Linux load averages are + % measured quite differently anyway %%%---------------------------------------------------------------------- --- ../../os_mon_ORIX/src/disksup.erl Thu Sep 14 12:27:36 2000 +++ disksup.erl Tue May 8 19:21:56 2001 @@ -15,6 +15,8 @@ %% %% $Id$ %% +%% 20010508 linux support added +%% -module(disksup). -export([start_link/0, get_disk_data/0, get_check_interval/0, @@ -79,7 +81,7 @@ Result = os_mon_sysinfo:get_disk_info(), check_disks_win32(Result, State#state.threshold); check_disk_space(State) when State#state.os == {unix, solaris} -> - Result = os:cmd("/usr/bin/df -lk"), + Result = os:cmd("/bin/df -lk"), check_disks_solaris(skip_to_eol(Result), State#state.threshold); check_disk_space(State) when State#state.os == {unix, sunos4} -> Result = os:cmd("df"), @@ -156,6 +158,9 @@ get_os() -> case os:type() of + {unix, linux} -> + {unix, solaris}; % This is a fake, but Solaris and Linux are similar + % enough by the grace of POSIX. It works. {unix, sunos} -> case os:version() of {5,_,_} -> {unix, solaris}; --- ../../os_mon_ORIX/src/memsup.erl Mon Sep 20 23:05:26 1999 +++ memsup.erl Tue May 8 19:22:50 2001 @@ -15,6 +15,8 @@ %% %% $Id$ %% +%% 20010508 linux support added +%% -module(memsup). -export([start_link/0, get_memory_data/0, get_check_interval/0, get_sysmem_high_watermark/0, get_procmem_high_watermark/0, @@ -62,6 +64,7 @@ process_flag(priority, low), PortResult = case OsType of {win32,_} ->{ok,not_used}; + {unix,linux} -> {ok,not_used}; _ -> start_portprogram() end, case PortResult of @@ -69,6 +72,8 @@ Reply = case OsType of {win32,_} -> get_memory_usage_win32(Port); + {unix,linux} -> + get_memory_usage_linux(Port); _ -> get_memory_usage(Port) end, @@ -109,6 +114,8 @@ MemUsage = case os:type() of {win32,_} -> get_memory_usage_win32(State#state.port); + {unix,linux} -> + get_memory_usage_linux(State#state.port); _ -> get_memory_usage(State#state.port) end, @@ -190,6 +197,17 @@ end. %%----------------------------------------------------------------- +%% get_memory_usage_linux(_Port) +%%----------------------------------------------------------------- +get_memory_usage_linux(_) -> + {ok,F}=file:open("/proc/meminfo",[read,raw]), + {ok,D}=file:read(F,1024), + {ok,[_Headers,MemInfo,Swap,MemTotal,MemFree,MemShared,Buffers,Cached,SwTot,SwFree,_]} = + regexp:split(D,"\n"), + {ok,[_,NMemTotal,NMemUsed],_}=io_lib:fread("~s ~d ~d",MemInfo), + {ok,{NMemUsed,NMemTotal}}. + +%%----------------------------------------------------------------- %% Func: get_memory_usage(Port) %% Purpose: Function which finds out how much memory is in use by %% using the external portprogram. @@ -262,6 +280,10 @@ _ -> {error, port_terminated} end; + {unix,linux} -> + {ok,{Alloced,Tot}} = get_memory_usage_linux([]), + [{total_memory,Tot},{free_memory, Tot-Alloced}, + {system_total_memory,Tot}]; % correct unless setrlimit() set _ -> Port ! {self(), {command, [?SYSTEM_MEM_SHOW]}}, collect_sysmem(Port) --- ../../os_mon_ORIX/src/os_mon.erl Mon Sep 20 23:05:51 1999 +++ os_mon.erl Tue May 8 19:22:30 2001 @@ -15,6 +15,8 @@ %% %% $Id$ %% +%% 20010508 linux support added +%% -module(os_mon). -behaviour(supervisor). @@ -57,6 +59,11 @@ start_memsup(), [], []}; + {unix,linux} -> + {start_disksup(), + start_memsup(), + start_cpu_sup(), + []}; _ -> {start_disksup(), start_memsup(), start_cpu_sup(), From eleberg@REDACTED Thu May 10 07:41:39 2001 From: eleberg@REDACTED (Bengt Kleberg) Date: Thu, 10 May 2001 07:41:39 +0200 (MET DST) Subject: escript and fun Message-ID: <200105100541.HAA21979@avc280.etxb.ericsson.se> Does funs work within escript? Test program (could be something else wrong with it): #!/usr/bin/env escript -export([main/1]). main( _X ) -> Fun = fun stop/0, Fun(). stop( ) -> io:format( "stop~n" ). Output of test program: {'init terminating in do_boot',{function_clause,[{erl_eval,expr,[{fun,6,{function,stop,0}},[{'_X',[]}],{value,#Fun}]},{erl_eval,exprs,4},{escript,code_handler,3},{erl_eval,local_func,4},{escript,interpret,2},{init,start_it,1},{init,start_em,1}]}} From salcaraz@REDACTED Thu May 10 20:34:15 2001 From: salcaraz@REDACTED (Salvador Alcaraz) Date: Thu, 10 May 2001 20:34:15 +0200 (CEST) Subject: Make tool in Erlang Message-ID: Hello, everybody: Is there any tool like Make (and makefile) for Erlang? Thank you _________________________________________________ Salvador Alcaraz Carrasco Division de Ingenieria Telematica Dpto. de Fisica y Arquitectura de Computadores Universidad Miguel Hernandez salcaraz@REDACTED http://obelix.umh.es __________________________________________________ From peter@REDACTED Thu May 10 20:43:30 2001 From: peter@REDACTED (Peter H|gfeldt) Date: Thu, 10 May 2001 20:43:30 +0200 (MET DST) Subject: Make tool in Erlang In-Reply-To: Message-ID: Yes, there is a a quite primitive make implemented in the module make. See the manual page make(3) (erl -man make will display the manual page at least on Unix). /Peter ------------------------------------------------------------------------- Peter H?gfeldt e-mail : peter@REDACTED Open Telecom Platform On Thu, 10 May 2001, Salvador Alcaraz wrote: > Hello, everybody: > > Is there any tool like Make (and makefile) for Erlang? > > Thank you > > > _________________________________________________ > Salvador Alcaraz Carrasco > Division de Ingenieria Telematica > Dpto. de Fisica y Arquitectura de Computadores > Universidad Miguel Hernandez > > salcaraz@REDACTED > http://obelix.umh.es > __________________________________________________ > From thierry@REDACTED Thu May 10 21:05:04 2001 From: thierry@REDACTED (Thierry Mallard) Date: Thu, 10 May 2001 21:05:04 +0200 Subject: Make tool in Erlang In-Reply-To: ; from salcaraz@obelix.umh.es on Thu, May 10, 2001 at 08:34:15PM +0200 References: Message-ID: <20010510210504.B17575@IDEALX.com> On Thu, May 10, 2001 at 08:34:15PM +0200, Salvador Alcaraz wrote: > Hello, everybody: > > Is there any tool like Make (and makefile) for Erlang? use the command make:all(). in the shell, for example :-) -- Thierry Mallard | http://vawis.net GnuPG key on wwwkeys.pgp.net | http://erlang-fr.org (new) key 0xA3D021CB | http://worldforge.org From Sean.Hinde@REDACTED Fri May 11 11:54:13 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Fri, 11 May 2001 10:54:13 +0100 Subject: Make tool in Erlang Message-ID: <402DD461F109D411977E0008C791C312039F5F88@imp02mbx.one2one.co.uk> > > On Thu, May 10, 2001 at 08:34:15PM +0200, Salvador Alcaraz wrote: > > Hello, everybody: > > > > Is there any tool like Make (and makefile) for Erlang? > > use the command make:all(). in the shell, for example :-) Or erl -make at the UNIX shell. If you use the OTP directory structure app-n.n/src, app-n.n/ebin etc you can have an Emakefile in your ebin directory containing entries like: '../src/module'. '../src/module_app'. then doing erl -make in the ebin directory will build the beam files there rather than in src. This is quicker that normal makefiles using erlc because the emulator is only started once. You might find it useful to also have some functions (examples below) defined in your user_default.erl.. so for me in an interactive session: ma(app_name). will remake the erl files in that app based on the Emakefile, regardless of the current erlang working directory ma(). makes in the current erlang working dir cde(app_name). changes erlang CWD to the ebin directory of app.. Happy interactive hacking, - Sean --------------------- -module(user_default). -author('otpuser@REDACTED'). -export([cds/1, cde/1, cdp/1, ma/0, ma/1, mevas/0]). cds(Lib) -> cd(Lib, "src"). cde(Lib) -> cd(Lib, "ebin"). cdp(Lib) -> cd(Lib, "priv"). cd(Lib, Dir) -> Lib_path = code:lib_dir(Lib), Path = filename:join([Lib_path, Dir]), c:cd(Path). ma(Lib) -> {ok, Pwd} = file:get_cwd(), cde(Lib), ma(), file:set_cwd(Pwd). ma() -> make:all([load]). %% this sort of thing I also find quite useful to rebuild all files in an interactive session mevas() -> ma(alarms), ma(bos), ma(events), ma(stats), ma(metrica), ma(http_mgr), ma(evas), ma(evas_gps), ma(tcp_ivr), ma(radius), ma(db_backup), ma(wap). NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From M.Withey@REDACTED Sat May 12 12:22:55 2001 From: M.Withey@REDACTED (Michael Withey) Date: Sat, 12 May 2001 11:22:55 +0100 Subject: Erlang C & Excel Message-ID: <000a01c0dacd$82fddd00$198bbc3e@gpfzqmga> I use an Erlang C calculation to assess Call Centre staff required on any given day. The team producing these figures currently use an Erlang calculator, which takes time to input figures and type the answers into an Excel Spreadsheet. Do you know where I can find an Excel formula download for Erlang C ? Do I use the GAMMADIST formula in Excel ? Also is Erlang C the most modern method used for estimating Call Centre traffic or are we a little out of date ? Best Regards, Mike (England) -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter@REDACTED Sat May 12 13:58:15 2001 From: peter@REDACTED (Peter H|gfeldt) Date: Sat, 12 May 2001 13:58:15 +0200 (MET DST) Subject: Erlang C & Excel In-Reply-To: <000a01c0dacd$82fddd00$198bbc3e@gpfzqmga> Message-ID: erlang.org is for the programming language Erlang. For traffic calculations, please try www.erlang.com. Regards, Peter ------------------------------------------------------------------------- Peter H?gfeldt e-mail : peter@REDACTED Open Telecom Platform Ericsson Utvecklings AB S-126 25 STOCKHOLM, Sweden On Sat, 12 May 2001, Michael Withey wrote: > > I use an Erlang C calculation to assess Call Centre staff required on any given day. > > The team producing these figures currently use an Erlang calculator, which takes time to input figures and type the answers into an Excel Spreadsheet. > > Do you know where I can find an Excel formula download for Erlang C ? Do I use the GAMMADIST formula in Excel ? > > Also is Erlang C the most modern method used for estimating Call Centre traffic or are we a little out of date ? > > Best Regards, > > Mike (England) > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdagefoerde@REDACTED Sat May 12 21:08:10 2001 From: jdagefoerde@REDACTED (=?iso-8859-1?Q? Jonas=20Dagef=F6rde ?=) Date: Sat, 12 May 2001 21:08:10 +0200 Subject: simple question Message-ID: <200105121908.f4CJ8Au08069@mailgate3.cinetic.de> Dear Sir or Madam, I'm trying to start "erl" or "werl" under Windows 98 with the argument "-pa " and/or "-pz ". I can see the key/value pair in the argument list returned by "init:get_arguments()". But if I try to load a module with "c(mymodule)", erlang doesn't find it, if it is in the "own_files" directory. What can I do so that I don't have to put all my source and header files in the "C:\Programme\erl5.0.2" directory? With regards Jonas Dagef?rde ______________________________________________________________________________ Ferienklick.de - 225 Reisekataloge auf einen Blick! Direkt zu Ihrem Traumurlaub: http://ferienklick.de/?PP=2-0-100-105-0 From luke@REDACTED Sat May 12 21:47:38 2001 From: luke@REDACTED (Luke Gorrie) Date: 12 May 2001 21:47:38 +0200 Subject: simple question In-Reply-To: <200105121908.f4CJ8Au08069@mailgate3.cinetic.de> References: <200105121908.f4CJ8Au08069@mailgate3.cinetic.de> Message-ID: "Jonas Dagef?rde" writes: > Dear Sir or Madam, I'm trying to start "erl" or "werl" under Windows > 98 with the argument "-pa " and/or "-pz ". I can > see the key/value pair in the argument list returned by > "init:get_arguments()". But if I try to load a module with > "c(mymodule)", erlang doesn't find it, if it is in the "own_files" > directory. What can I do so that I don't have to put all my source and > header files in the "C:\Programme\erl5.0.2" directory? c(mymodule) actually compiles (and loads) the mymodule.erl file down to mymodule.beam. It does this in the current directory, so you'll want to do: cd("c:/directory/with/my/module/"). Before doing c(mymodule) Using "-pa" makes erlang automatically load the module (from the .beam file) from that directory when its needed, if its already compiled. So you can use it for pointing erlang at the code that you've already c()'d. Cheers, Madam Luke From cahill@REDACTED Sun May 13 15:00:28 2001 From: cahill@REDACTED (Adrian Cahill) Date: Sun, 13 May 2001 14:00:28 +0100 Subject: odbc system load and snmp system load Message-ID: <000a01c0dbac$afa57d10$dd9fef8f@ucc.ie> Hi, I am trying to find out what sort of increase on system loads is caused by using the Erlang ODBC module, and sending odbc requests, also wat kind of load is incurred by sending SNMP requests. Has anyone done any calculations on these? TIA Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From vances@REDACTED Tue May 15 01:26:13 2001 From: vances@REDACTED (Vance Shipley) Date: Mon, 14 May 2001 19:26:13 -0400 Subject: indentation: tabs vs. spaces Message-ID: Did you ever notice that the source mixes indentation styles? Some lines are indented with tabs (as it should be :) while others are indented with spaces? It really screws me up when I look at it with my tabstops set at 3 as I have my editor set up. Setting tabstops to 8 makes it look right. -Vance From maurice@REDACTED Tue May 15 01:41:46 2001 From: maurice@REDACTED (Maurice Castro) Date: Tue, 15 May 2001 09:41:46 +1000 (EST) Subject: indentation: tabs vs. spaces In-Reply-To: from Vance Shipley at "May 14, 2001 07:26:13 pm" Message-ID: <200105142341.JAA01546@parallel.serc.rmit.edu.au> > Did you ever notice that the source mixes indentation styles? One word: EMACS Maurice Castro From eleberg@REDACTED Tue May 15 10:25:10 2001 From: eleberg@REDACTED (Bengt Kleberg) Date: Tue, 15 May 2001 10:25:10 +0200 (MET DST) Subject: indentation: tabs vs. spaces Message-ID: <200105150825.KAA21525@avc280.etxb.ericsson.se> > > Did you ever notice that the source mixes indentation styles? > > One word: EMACS Or: indent (For us that never learned emacs) From srl@REDACTED Tue May 15 10:58:01 2001 From: srl@REDACTED (Steve Langstaff) Date: Tue, 15 May 2001 09:58:01 +0100 Subject: indentation: tabs vs. spaces Message-ID: <01C0DD25.87AD1690.srl@terminus.ericsson.se> On 15 May 2001 00:42, Maurice Castro [SMTP:maurice@REDACTED] wrote: > > Did you ever notice that the source mixes indentation styles? > > One word: EMACS Cause or salvation? -- Steve L. From bjorn@REDACTED Tue May 15 11:00:21 2001 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 15 May 2001 11:00:21 +0200 Subject: indentation: tabs vs. spaces In-Reply-To: Steve Langstaff's message of "Tue, 15 May 2001 09:58:01 +0100" References: <01C0DD25.87AD1690.srl@terminus.ericsson.se> Message-ID: Steve Langstaff writes: > On 15 May 2001 00:42, Maurice Castro [SMTP:maurice@REDACTED] wrote: > > > Did you ever notice that the source mixes indentation styles? > > > > One word: EMACS > > Cause or salvation? Both. /Bjorn -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From Sean.Hinde@REDACTED Tue May 15 11:02:01 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Tue, 15 May 2001 10:02:01 +0100 Subject: indentation: tabs vs. spaces Message-ID: <402DD461F109D411977E0008C791C312039F5FAF@imp02mbx.one2one.co.uk> > On 15 May 2001 00:42, Maurice Castro > [SMTP:maurice@REDACTED] wrote: > > > Did you ever notice that the source mixes indentation styles? > > > > One word: EMACS > > Cause or salvation? Both! Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From luke@REDACTED Tue May 15 16:42:37 2001 From: luke@REDACTED (Luke Gorrie) Date: 15 May 2001 16:42:37 +0200 Subject: shbuf-1.1 [Was: Re: indentation: tabs vs. spaces] In-Reply-To: <200105142341.JAA01546@parallel.serc.rmit.edu.au> References: <200105142341.JAA01546@parallel.serc.rmit.edu.au> Message-ID: Maurice Castro writes: > One word: EMACS Sounds like a queue to mention an Exciting new emacs/erlang hack! I implemented network-shared buffers in Emacs using an Erlang server. One-writer-at-a-time but nice'n'fast for him. Runs as a minor mode. http://www.bluetail.com/~luke/shbuf/shbuf-1.1.tar.gz Cheers, Luke From voudheus@REDACTED Wed May 16 11:20:43 2001 From: voudheus@REDACTED (Karel Van Oudheusden) Date: Wed, 16 May 2001 11:20:43 +0200 Subject: receive statement in Erlang Message-ID: <3B02466B.E023F3CB@imec.be> Hello, In the attached file I have put a small Erlang program. After compilation I get two warning messages and the program doesn't work the way I want it to work. I would appreciate it if somebody could: - tell me what I am doing wrong - express his thoughts about the style of programming I used The program has a total of four processes: one initial process, one screen process, and two ball processes. In the long run, I intend to make this program much more complex: I want to have many balls moving on the screen and this will be done over different computers (nodes). Thank you very much, Karel. -------------- next part -------------- A non-text attachment was scrubbed... Name: ball.erl Type: application/x-unknown-content-type-erl_auto_file Size: 4549 bytes Desc: not available URL: From vances@REDACTED Wed May 16 23:24:28 2001 From: vances@REDACTED (Vance Shipley) Date: Wed, 16 May 2001 17:24:28 -0400 Subject: receive statement in Erlang In-Reply-To: <3B02466B.E023F3CB@imec.be> Message-ID: karel writes: } I would appreciate it if somebody could: } - tell me what I am doing wrong } - express his thoughts about the style of programming I used The reason it is crashing is that inside screenloop/2 you end up doing: gs:config(Curball,{move,{DX,DY}}) when Curball isn't a valid argument to gs:config. This is because the receive loop in screenloop/2 is receiving an extra being sent in from init/0. The reason for this is that you have the function to send the initial message to each ball process inside the screenloop/2 function. This means that everytime you reenter the screenloop/2 function you send another initial message to the ball function. Move it into the tail end of init(): init() -> ... map(fun(X) -> X ! {screenpid, self()} end, Balls), screenloop(C,Balls). Nothe that I have also taken the liberty of changing the message so that it is more specific than just the . In general your code here is not very robust because you are not checking the messages which you are receiving. The screenloop/2 receive statement is not bad, you are looking for messages which have obviously come from your self so you can rely on yourself to know they are valid: {From, startball, {K,L,M,N,Color}} -> {From, moveball, {Curball, {DX, DY}}} -> These are good. The trouble here though is that if you get another message, from somewhere, you won't eat it up and it will stay there forever. In fact you send yourself a message which you aren't catching! From ! {self(),true}; This is also a bad format. I'm not sure what you intended here removing it sure helped! You should always have a catchall at the end of a receive like maybe: Other -> io:format(screenloop: received bogus message ~w~n", [Other]) I would take apart the initball/2 function and have the initial receive loop in one function and the second in another. This would allow you to have: init1(...) -> receive {screenpid, Screenpid} -> link(Screenpid), init2(...); Other -> init1(...) end. init2(...) -> receive {A, B} when pid(B) -> ball({A, B}}, Screenpid, {X, Y, DX, DY}); Other -> io:format(initball: received bogus message ~w~n", [Other]), init2(...) end. And I can't skip the opportunity to complain about tabs vs. spaces. :) You mix them here which I find makes things hard to read. Especially when you aren't consistent! I know this is my particular rant but let me leave you with this: receive Screenpid -> link(Screenpid) end, Should be: receive Screenpid -> link(Screenpid) end, -Vance From Sean.Hinde@REDACTED Thu May 17 10:58:00 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Thu, 17 May 2001 09:58:00 +0100 Subject: receive statement in Erlang Message-ID: <402DD461F109D411977E0008C791C312039F5FD2@imp02mbx.one2one.co.uk> Vance: > And I can't skip the opportunity to complain about tabs vs. spaces. :) > You mix them here which I find makes things hard to read. Especially > when you aren't consistent! I know this is my particular rant but let > me leave you with this: > > receive > Screenpid -> > link(Screenpid) > end, > > Should be: > > receive > Screenpid -> > link(Screenpid) > end, I really don't think it is possible to nicely format Erlang code without using spaces. What about: function_with_lots_of_parameters(Param1, Param2, Parameter_with_long_name, Another_long_parameter, Final_parameter) -> And many other times where a bunch of things go across multiple lines but need to be indented up to their buddies. Emacs deals with this by tabbing until nearly there and then adding spaces (all with a single press of the TAB key). It might be even better to set it up to use just spaces for consistency with other editors but I just use Emacs.. Regards, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From vances@REDACTED Thu May 17 11:13:28 2001 From: vances@REDACTED (Vance Shipley) Date: Thu, 17 May 2001 05:13:28 -0400 Subject: receive statement in Erlang In-Reply-To: <402DD461F109D411977E0008C791C312039F5FD2@imp02mbx.one2one.co.uk> Message-ID: Sean Hinde writes: > > I really don't think it is possible to nicely format Erlang code without > using spaces. What about: > > function_with_lots_of_parameters(Param1, Param2, Parameter_with_long_name, > Another_long_parameter, > Final_parameter) -> I use the rule that if it's being continued it's one stop more than if it were the next line: function_with_lots_of_parameters(Param1, Param2, Parameter_with_long_name, Another_long_parameter, And_yet_another, And_another, And_another_long_parameter, And_yet_another, And_another, And_one_more) -> foo(Param1), foo(Param2), That works for me. It's simply beautiful to see when all your code changes to fit with one command (changing the tabstops in the editor). If the code is simple leave the tabs at 8. If it get's to long and indented many times than change to tabs=5 or even 1 if neccesary. Now before someone else says it; yes it's probably time for another function by then but I'd say sometime after tabs=5 anyway. (I use 3). -Vance From mbj@REDACTED Mon May 14 09:29:29 2001 From: mbj@REDACTED (Martin Bjorklund) Date: Mon, 14 May 2001 09:29:29 +0200 Subject: simple question In-Reply-To: Your message of "12 May 2001 21:47:38 +0200" References: Message-ID: <20010514092929U.mbj@bluetail.com> Luke Gorrie wrote: > "Jonas Dagef?rde" writes: > > > Dear Sir or Madam, I'm trying to start "erl" or "werl" under Windows > > 98 with the argument "-pa " and/or "-pz ". I can > > see the key/value pair in the argument list returned by > > "init:get_arguments()". But if I try to load a module with > > "c(mymodule)", erlang doesn't find it, if it is in the "own_files" > > directory. What can I do so that I don't have to put all my source and > > header files in the "C:\Programme\erl5.0.2" directory? > > c(mymodule) actually compiles (and loads) the mymodule.erl file down > to mymodule.beam. And if you have the compiled (.beam) file in your path, you can do l(mymodule) to load it. I.e. c(mymodule) compiles mymodule.erl from *current dir* to mymodule.beam, and loads mymodule.beam l(mymodule) loads mymodule.beam from the code path (code:get_path()). /martin From Sean.Hinde@REDACTED Thu May 17 11:42:28 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Thu, 17 May 2001 10:42:28 +0100 Subject: receive statement in Erlang Message-ID: <402DD461F109D411977E0008C791C312039F5FD3@imp02mbx.one2one.co.uk> > That works for me. It's simply beautiful to see when all your code > changes to fit with one command (changing the tabstops in the editor). Sad though it may be I do join you in this concept of beauty.. Beauty to me is also seeing all my variable names in neon Blue, function headers in bold black, hitting the TAB key anywhere in the line and seeing the whole line skip neatly into place (Ooh). Semicolon creating the next function header and placing the cursor ready to put in the variable names (Aahh). I will admit that I get around the problem of complex functions overflowing by having a big screen! Maybe Luke will get his editor refactoring nested case clauses into new functions at a key press soon? -Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From voudheus@REDACTED Thu May 17 13:07:38 2001 From: voudheus@REDACTED (Karel Van Oudheusden) Date: Thu, 17 May 2001 13:07:38 +0200 Subject: tcp/ip and Erlang Message-ID: <3B03B0FA.35E02C5C@imec.be> First of all I would like to thank every one for the answers I received for my previous question. They were very helpful. I just have a short second question. I am planning to work distributed over different Erlang nodes with TCP/IP. I am also planning to use Ethereal (or tcpdump) to observe the packets that are sent between two Erlang nodes. To correctly interpret the data bits of the packets, I have to understand how Erlang puts the Erlang data in this TCP format. In addition I am interested in how the sender PID (of the sending process) and the receiver PID (of the receiving process on another computer) are stored in the data part of the packet. Any hints are welcome. I'd probably be able to find this out by myself, but I am short in time. Therefore any help would be great. If anybody has written code to interpret Erlang packets (in conformance with TCP/IP) and doesn't mind sharing it, please inform me. thanks a lot, Karel. From Sean.Hinde@REDACTED Thu May 17 13:33:16 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Thu, 17 May 2001 12:33:16 +0100 Subject: tcp/ip and Erlang Message-ID: <402DD461F109D411977E0008C791C312039F5FDB@imp02mbx.one2one.co.uk> There is a file in: erts/emulator/internal_doc/erl_ext_dist.txt which has some explanation. I've no idea if this is up to date or not. If you want to check how something is defined in the external term format you can use: 1> term_to_binary(1). <<131,97,1>> 2> term_to_binary([1,2,3]). <<131,107,0,3,1,2,3>> 3> binary_to_term(<<131,107,0,3,1,2,3>>). [1,2,3] - Sean > -----Original Message----- > From: Karel Van Oudheusden [mailto:voudheus@REDACTED] > Sent: 17 May 2001 12:08 > To: erlang-questions@REDACTED > Subject: tcp/ip and Erlang > > > First of all I would like to thank every one for the answers > I received > for my previous question. They were very helpful. > > > I just have a short second question. I am planning to work > distributed > over different Erlang nodes with TCP/IP. I am also planning to use > Ethereal (or tcpdump) to observe the packets that are sent between two > Erlang nodes. To correctly interpret the data bits of the packets, I > have to understand how Erlang puts the Erlang data in this > TCP format. > In addition I am interested in how the sender PID (of the sending > process) and the receiver PID (of the receiving process on another > computer) are stored in the data part of the packet. > > > Any hints are welcome. I'd probably be able to find this out > by myself, > but I am short in time. Therefore any help would be great. If anybody > has written code to interpret Erlang packets (in conformance with > TCP/IP) and doesn't mind sharing it, please inform me. > > > > thanks a lot, > Karel. > NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From vances@REDACTED Thu May 17 13:36:25 2001 From: vances@REDACTED (Vance Shipley) Date: Thu, 17 May 2001 07:36:25 -0400 Subject: editor wars In-Reply-To: <402DD461F109D411977E0008C791C312039F5FD3@imp02mbx.one2one.co.uk> Message-ID: When I opened this can of worms recently I had no idea it was an emacs thing, although I probably should have. One week I will set work aside and learn emacs. I'm sure it will eventually pay off. -Vance From daniel.neri@REDACTED Thu May 17 15:47:17 2001 From: daniel.neri@REDACTED (Daniel =?iso-8859-1?q?N=E9ri?=) Date: 17 May 2001 15:47:17 +0200 Subject: editor wars In-Reply-To: References: Message-ID: "Vance Shipley" writes: > When I opened this can of worms recently I had no idea it was an > emacs thing, although I probably should have. A tab is 8 spaces wide. IMO, any attempt to change this will only lead to agony, if not for yourself, then for someone else trying to browse your code with a different editor/tool than you. If you want smaller indents, just use plain spaces. > One week I will set work aside and learn emacs. I'm sure it will > eventually pay off. Have fun ;-) Regards, --Daniel -- Daniel Neri mailto:dn@REDACTED Sigicom AB, Sweden http://www.sigicom.com From hal@REDACTED Thu May 17 16:00:11 2001 From: hal@REDACTED (Hal Snyder) Date: 17 May 2001 09:00:11 -0500 Subject: editor wars In-Reply-To: "Vance Shipley"'s message of "Thu, 17 May 2001 07:36:25 -0400" References: Message-ID: <87bsosnkic.fsf@ghidra.vail> "Vance Shipley" writes: > When I opened this can of worms recently I had no idea > it was an emacs thing, although I probably should have. > > One week I will set work aside and learn emacs. I'm > sure it will eventually pay off. I like *both* editors, vi and XEmacs. and both databases, mnesia and postgresql, etc. From rv@REDACTED Thu May 17 16:05:09 2001 From: rv@REDACTED (Robert Virding) Date: Thu, 17 May 2001 16:05:09 +0200 Subject: editor wars In-Reply-To: Your message of "17 May 2001 15:47:17 +0200." Message-ID: <200105171405.QAA02872@trana.bluetail.com> daniel.neri@REDACTED (Daniel =?iso-8859-1?q?N=E9ri?=) writes: >"Vance Shipley" writes: > >> When I opened this can of worms recently I had no idea it was an >> emacs thing, although I probably should have. > >A tab is 8 spaces wide. IMO, any attempt to change this will only lead >to agony, if not for yourself, then for someone else trying to browse >your code with a different editor/tool than you. > >If you want smaller indents, just use plain spaces. It depends what you mean by 'tab'. If you mean typing the TAB character then that usually means "tab to the next tab stop" where the next tab stop is application dependant. The TAB character in a file also means "tab to the next tab stop" where the next tab stop is commonly is the next 8th character position. Some editors mix the two meanings and change the tabbing by inserting tab characters into the file and changing the meaning of the tab character. This is a big lose as it is not portable, even to the same editor with a different set up. Emacs, and many other editors, keep the two separate. Pressing the TAB key moves to the next tab stop by inserting a suitable number of TAB characters and spaces keeping the "standard" meaning of the TAB character. This is sensible and portable. Robert -- Robert Virding Tel: +46 (0)8 545 55 017 Alteon Web Systems Email: rv@REDACTED S:t Eriksgatan 44 WWW: http://www.bluetail.com/~rv SE-112 34 Stockholm, SWEDEN "Folk s?ger att jag inte bryr mig om n?gonting, men det skiter jag i". From Sean.Hinde@REDACTED Thu May 17 16:22:56 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Thu, 17 May 2001 15:22:56 +0100 Subject: database wars Message-ID: <402DD461F109D411977E0008C791C312039F5FEF@imp02mbx.one2one.co.uk> Hal Snyder wrote: > and both databases, mnesia and postgresql, etc. Are you using the ODBC interface for postgresql? Any issues with it? Reasonable performance? Is anyone else using odbc with Oracle? Thanks, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From daniel.neri@REDACTED Thu May 17 16:59:56 2001 From: daniel.neri@REDACTED (Daniel =?iso-8859-1?q?N=E9ri?=) Date: 17 May 2001 16:59:56 +0200 Subject: editor wars In-Reply-To: <200105171405.QAA02872@trana.bluetail.com> References: <200105171405.QAA02872@trana.bluetail.com> Message-ID: Robert Virding writes: > It depends what you mean by 'tab'. If you mean typing the TAB > character then that usually means "tab to the next tab stop" where > the next tab stop is application dependant. The TAB character in a > file also means "tab to the next tab stop" where the next tab stop > is commonly is the next 8th character position. True. I was disregarding the tab stop concept... > Emacs, and many other editors, keep the two separate. Pressing the > TAB key moves to the next tab stop by inserting a suitable number of > TAB characters and spaces keeping the "standard" meaning of the TAB > character. This is sensible and portable. Yes, but my original point was that, even though your editor acts sensibly in this regard, if you set the "tab width" to anything not equal to 8, you will most likely produce text that renders badly for a majority of people. Especially when it comes to source code. The most portable approach is of course to setup your editor to automatically "expand" tabs to spaces when buffers are flushed, as recommended in http://www.jwz.org/doc/tabs-vs-spaces.html Best wishes, --Daniel -- Daniel Neri mailto:dn@REDACTED Sigicom AB, Sweden http://www.sigicom.com From bruce@REDACTED Thu May 17 23:59:12 2001 From: bruce@REDACTED (Bruce Fitzsimons) Date: Fri, 18 May 2001 09:59:12 +1200 Subject: Q: Simple list transform Message-ID: <052901c0df1c$9ba47aa0$5f00a8c0@SLANT> Gidday, Its the simpliest things that give me trouble in Erlang. I am trying to work out how I can transform the list [0,1,2,3,4] into the list [{0,Y},{1,Y},{2,Y},{3,Y},{4,Y}]. I've looked at map, but the function only takes one argument (an array element) and I can't see a way to wedge another one in. I think I'm correct in assuming that unless I pass a variable as an argument to a fun it doesn't have it in its scope, so I can't do this: Y = "really cool id", IdList = [0,1,2,3,4] , map(fun(Num) -> {Num, Y} end,IdList). I know I could do it the traditional way and use two functions to iterate the list, slicing off one item at a time and accumulating the result. Is there an easier/nicer way? Thanks in advance, Bruce From kent@REDACTED Fri May 18 00:19:08 2001 From: kent@REDACTED (Kent Boortz) Date: 18 May 2001 00:19:08 +0200 Subject: Q: Simple list transform In-Reply-To: "Bruce Fitzsimons"'s message of "Fri, 18 May 2001 09:59:12 +1200" References: <052901c0df1c$9ba47aa0$5f00a8c0@SLANT> Message-ID: > Its the simpliest things that give me trouble in Erlang. I am trying to work > out how I can transform the list [0,1,2,3,4] into the list > [{0,Y},{1,Y},{2,Y},{3,Y},{4,Y}]. > > I've looked at map, but the function only takes one argument (an array > element) and I can't see a way to wedge another one in. I think I'm correct > in assuming that unless I pass a variable as an argument to a fun it doesn't > have it in its scope, so I can't do this: > > Y = "really cool id", > IdList = [0,1,2,3,4] , > map(fun(Num) -> {Num, Y} end,IdList). This code works fine. Look at the scoping rules section 2.4 in http://www.erlang.org/doc/r7b/doc/extensions/funs.html kent From happi@REDACTED Fri May 18 00:21:34 2001 From: happi@REDACTED (Erik Johansson) Date: Fri, 18 May 2001 00:21:34 +0200 Subject: Simple list transform References: <052901c0df1c$9ba47aa0$5f00a8c0@SLANT> Message-ID: <002001c0df1f$bbaaff60$c90b0a0a@student.uu.se> > Gidday, > > Its the simpliest things that give me trouble in Erlang. I am trying to work > out how I can transform the list [0,1,2,3,4] into the list > [{0,Y},{1,Y},{2,Y},{3,Y},{4,Y}]. > > I've looked at map, but the function only takes one argument (an array > element) and I can't see a way to wedge another one in. I think I'm correct > in assuming that unless I pass a variable as an argument to a fun it doesn't > have it in its scope , so I can't do this: > > Y = "really cool id", > IdList = [0,1,2,3,4] , > map(fun(Num) -> {Num, Y} end,IdList). But you can, as long as Y is bound in the scope where the fun is created. (You want to use lists:map though): -module(m). -export([t/0]). t() -> Y = "really cool id", IdList = [0,1,2,3,4] , lists:map(fun(Num) -> {Num, Y} end,IdList). === Testrun: Erlang (BEAM) emulator version 5.1 [source] [hipe] Eshell V5.1 (abort with ^G) 1> c(m). {ok,m} 2> m:t(). [{0,"really cool id"}, {1,"really cool id"}, {2,"really cool id"}, {3,"really cool id"}, {4,"really cool id"}] 3> > I know I could do it the traditional way and use two functions to iterate > the list, slicing off one item at a time and accumulating the result. Is > there an easier/nicer way? Well, as you have seen there are. There are other ways like: -module(m). -export([y/1,t/0]). y(N) -> {N,"really cool id"}. t() -> IdList = [0,1,2,3,4] , lists:map(fun y/1,IdList). === testrun: 8> c(m). {ok,m} 9> m:t(). [{0,"really cool id"}, {1,"really cool id"}, {2,"really cool id"}, {3,"really cool id"}, {4,"really cool id"}] (I hope I didn't spoil some homework now... but since you almost had it anyway I guess no harm is done) /Erik From jamesh@REDACTED Fri May 18 00:43:29 2001 From: jamesh@REDACTED (James Hague) Date: Thu, 17 May 2001 17:43:29 -0500 Subject: Simple list transform Message-ID: > Its the simpliest things that give me trouble in Erlang. I am > trying to work > out how I can transform the list [0,1,2,3,4] into the list > [{0,Y},{1,Y},{2,Y},{3,Y},{4,Y}]. [{X,id}|| X <- [0,1,2,3,4]]. gives: [{0,id},{1,id},{2,id},{3,id},{4,id}] You can try this directly from the Erlang shell! James From bruce.fitzsimons@REDACTED Fri May 18 00:48:23 2001 From: bruce.fitzsimons@REDACTED (Bruce Fitzsimons) Date: Fri, 18 May 2001 10:48:23 +1200 Subject: Q: Simple list transform Message-ID: <058101c0df23$7aaab0b0$5f00a8c0@SLANT> (forgot to send this to the list as well) Thanks Kent and Erik for the rapid and complete answers...the lightbulb in my head about the usefulness of Funs is now on. Cool. I love this language. Cheers, Bruce From jakob@REDACTED Fri May 18 10:17:31 2001 From: jakob@REDACTED (Jakob Cederlund =?iso-8859-1?Q?på?= UAB) Date: Fri, 18 May 2001 10:17:31 +0200 Subject: tcp/ip and Erlang Message-ID: <5.0.2.1.0.20010518101620.02d61270@mail> Note that in erl_interface there is a library "ei", which contains C code to translate to and from the binary term format. It's not yet documented, but it should be easy to use anyway. (The C code is in the encode_*.[ch] and decode_*.[ch] files.) /Jakob From voudheus@REDACTED Fri May 18 11:35:54 2001 From: voudheus@REDACTED (Karel Van Oudheusden) Date: Fri, 18 May 2001 11:35:54 +0200 Subject: registering processes Message-ID: <3B04ECFA.52753A62@imec.be> Hello, I have a question on distributed computing. I have implemented a distributed program on two computers: computer A and computer B. Computer A executes the local erlang compiled file 'A.beam' while computer B executes the file 'B.beam'. 'A.erl' is the source code version of 'A.beam'. 'B.erl' is the source code version of 'B.beam'. In 'B.erl' I have spawned a process and registered it under a name. I have done this by using the 'register(Name, Pid)' command. This allows processes on computer A to communicate with this specific process located on computer B. The command I used is: {registeredName, PID} ! message This works fine. However, the following does not work: When a process on computer A communicates with the registered process on computer B, some new processes are spawned on computer B as a result. These newly spawned processes (which are not registered) send their PID to the processes on computer A. After some time, a process on computer A tries to send a message to one of these newly spawned processes on computer B by just using the PID of the latter: PID ! message This does not work and if I'm not mistaken, this is because PID's are only local identifiers of processes. Therefore I am wandering whether a command similar to the following exists: {otherNode(), PID} ! message In which otherNode() gives the IP address of computer B. Stated otherwise, how do I "register" processes that are spawned during execution of the program, without having to define new names for all these processes? thanx, KVO. From cesarini@REDACTED Fri May 18 11:46:18 2001 From: cesarini@REDACTED (Francesco Cesarini) Date: Fri, 18 May 2001 10:46:18 +0100 Subject: registering processes References: <3B04ECFA.52753A62@imec.be> Message-ID: <3B04EF6A.6017187B@terminus.ericsson.se> What you describe should work, as processes are unique within a network of meshed Erlang nodes, so you should be able to use the Pid to send messages to different nodes. What is probably happening is that one of your newly spawned processes is terminating (normally or abnormally) but you don't notice as no error print outs occur. So when you try to send a message to it, it is just thrown away. I would suggest you use the debugger to monitor the well being of your processes (On both nodes), and ensure that the receiver is alive when you send the message to it. You could also use proc_lib:spawn/3 to spawn your processes, causing error print outs when they terminate. Regards, Francesco -- Francesco Cesarini Erlang/OTP consultant Cellular: INT+44-7776 250381 ECN: 832-707192 http://welcome.to/cesarini.consultuing From garry@REDACTED Fri May 18 19:58:28 2001 From: garry@REDACTED (Garry Hodgson) Date: Fri, 18 May 2001 13:58:28 -0400 Subject: strange behavior on port send Message-ID: <3B0562C4.7FB49727@sage.att.com> i'm trying to interface to an external application, and having some problems. i'm using code derived from the "Section 4. Ports" example in the interoperability tutorial. the external application is a colleague's, and i wanted to use the port mechanism to make it easy for her to interface. if i build the external program in python, and have it read its input using the standard python readlines() call, the programs work just fine. to make this work, i use the (default) stream and use_stdio options in the open_port() call. so now, i'm trying instead to connect it to another program, written in c. if i run the program by hand, and type commands at it, it works just fine. if i have the erlang open_port() spawn it, when i send a message i get: =ERROR REPORT==== 19-May-2001::01:38:50 === Bad value on output port '/usr/local/wnet/srv/bravosrv -e /usr/local/wnet/srv/sample.wnet' i've tried all variations i can think of to fix this. i use an explicit read() call, rather than stdin, though i get the same behavior if i use gets(). i've change it to use the {packet, 2} option on the erlang side instead, with the read_cmd() call from the tutorial's sample code. same thing. when i first started this stuff, i compiled and ran the tutorial's example code, and it worked fine. so i know there's nothing inherent in talking to c that is a problem. the program i'm trying to talk to does nothing nasty that i can see, but it calls some functions to initialize a large backend set of libraries, written in a mix of c and tcl, and i'm wondering if maybe there's some ugliness being done to the file descriptors behind our backs. does anyone have any ideas? thanks -- Garry Hodgson sometimes we ride on your horses Senior Hacker sometimes we walk alone Software Innovation Services sometimes the songs that we hear AT&T Labs are just songs of our own garry@REDACTED From garry@REDACTED Fri May 18 20:43:52 2001 From: garry@REDACTED (Garry Hodgson) Date: Fri, 18 May 2001 14:43:52 -0400 Subject: strange behavior on port send Message-ID: <3B056D68.435472BF@sage.att.com> Garry Hodgson (that's me) wrote: > i'm trying to interface to an external application, and having > some problems. i'm using code derived from the "Section 4. Ports" > example in the interoperability tutorial. errrrr....uhhhhhh....never mind. i'd done something stupid, adding a debug statement at the end of the encode() routine, so the wrong value was ascribed to the function. that'll teach me to read the error message more carefully. sorry. -- Garry Hodgson sometimes we ride on your horses Senior Hacker sometimes we walk alone Software Innovation Services sometimes the songs that we hear AT&T Labs are just songs of our own garry@REDACTED From bruce@REDACTED Mon May 21 02:01:10 2001 From: bruce@REDACTED (Bruce Fitzsimons) Date: Mon, 21 May 2001 12:01:10 +1200 Subject: ASN.1 decoding problems with H.323 Message-ID: <064601c0e189$248e0430$5f00a8c0@SLANT> Hello again, I am having problems with the ASN.1 per decoding in R7B. If you are familiar with H323 then this is specifically when the endpointAlias field of the Gatekeeper contains an E164 alias. It works fine with H323 aliases, but consistently fails if there is an E164 (telephone number). This is from several different clients on the sending side, so I don't believe that the source encoding is faulty. If someone could give me an hints on debugging the ASN.1 decoding it would be appreciated. I'm going to start reverse-engineering what its doing internally... The decoding failed with reason {function_clause, [{asn1rt_per_v1,getbit1,[{0,[]}]}, {asn1rt_per_v1,getbits,3}, {asn1rt_per_v1,chars_decode2,5}, {'H323-MESSAGES',dec_AliasAddress,2}, {'H323-MESSAGES', dec_GatekeeperRequest_endpointAlias_components, 4}, {'H323-MESSAGES',dec_GatekeeperRequest,2}, {'H323-MESSAGES',dec_RasMessage,2}, {asn1rt,decode,3}| more]} Cheers, Bruce PS Is there any plans for a per_bin option? From klacke@REDACTED Mon May 21 10:56:13 2001 From: klacke@REDACTED (Klacke) Date: Mon, 21 May 2001 10:56:13 +0200 Subject: strange behavior on port send In-Reply-To: <3B056D68.435472BF@sage.att.com>; from garry@sage.att.com on Fri, May 18, 2001 at 02:43:52PM -0400 References: <3B056D68.435472BF@sage.att.com> Message-ID: <20010521105613.A8294@bluetail.com> On Fri, May 18, 2001 at 02:43:52PM -0400, Garry Hodgson wrote: > > Garry Hodgson (that's me) wrote: > > > i'm trying to interface to an external application, and having > > some problems. i'm using code derived from the "Section 4. Ports" > > example in the interoperability tutorial. > > errrrr....uhhhhhh....never mind. > > > > i'd done something stupid, adding a debug statement at the end > of the encode() routine, so the wrong value was ascribed to the > function. > that'll teach me to read the error message more carefully. > eggs and all ... there's another minor problem that typically needs to be taken care of when using open_port(... , [{packet, 0} ... and that is buffering printf()'s from the c program at the other end of the Erlang port. Here's a code snippet: char b1[BUFSIZ], b2[BUFSIZ], b3[BUFSIZ]; setvbuf(stdin, b1, _IOLBF, BUFSIZ); setvbuf(stdout, b2, _IOLBF, BUFSIZ); setvbuf(stderr, b3, _IOLBF, BUFSIZ); /klacke -- Claes Wikstrom -- Caps lock is nowhere and Alteon WebSystems -- everything is under control http://www.bluetail.com/~klacke -- From eleberg@REDACTED Mon May 21 18:17:05 2001 From: eleberg@REDACTED (Bengt Kleberg) Date: Mon, 21 May 2001 18:17:05 +0200 (MET DST) Subject: building r7b-2 on solaris Message-ID: <200105211617.SAA06125@avc280.etxb.ericsson.se> greetings, when doing ./configure gmake on a solaris machine i get the error message make[2]: sparc-sun-solaris2.7/Makefile: no such file or directory which is true, there is no sparc-sun-solaris2.7 directory. this directory (with Makefile) is expected by $ERL_TOP/make/run_make.mk (included by $ERL_TOP/erts/emulator/Makefile). Who/When should have created this directory/file? bengt kleberg From sam@REDACTED Mon May 21 19:00:54 2001 From: sam@REDACTED (Samuel Tardieu) Date: 21 May 2001 19:00:54 +0200 Subject: config.guess and config.sub are outdated Message-ID: <2001-05-21-19-00-54+trackit+sam@inf.enst.fr> The current config.guess and config.sub are outdated, and do not allow Erlang to be built on hppa, s390 or SH versions of Debian GNU/Linux. Could the Erlang maintainers update their copy with the ones found at http://subversions.gnu.org/cgi-bin/cvsweb/config/ ? This will help spread the Erlang good words :) Sam -- Samuel Tardieu -- sam@REDACTED From bertil.karlsson@REDACTED Mon May 21 19:05:36 2001 From: bertil.karlsson@REDACTED (Bertil Karlsson) Date: Mon, 21 May 2001 19:05:36 +0200 Subject: ASN.1 decoding problems with H.323 References: <064601c0e189$248e0430$5f00a8c0@SLANT> Message-ID: <3B094AE0.270B44F5@uab.ericsson.se> Bruce Fitzsimons wrote: > > Hello again, > > I am having problems with the ASN.1 per decoding in R7B. If you are familiar > with H323 then this is specifically when the endpointAlias field of the > Gatekeeper contains an E164 alias. It works fine with H323 aliases, but > consistently fails if there is an E164 (telephone number). This is from > several different clients on the sending side, so I don't believe that the > source encoding is faulty. > > If someone could give me an hints on debugging the ASN.1 decoding it would > be appreciated. I'm going to start reverse-engineering what its doing > internally... > > The decoding failed with reason {function_clause, > [{asn1rt_per_v1,getbit1,[{0,[]}]}, > {asn1rt_per_v1,getbits,3}, > {asn1rt_per_v1,chars_decode2,5}, > {'H323-MESSAGES',dec_AliasAddress,2}, > {'H323-MESSAGES', > > dec_GatekeeperRequest_endpointAlias_components, > 4}, > > {'H323-MESSAGES',dec_GatekeeperRequest,2}, > {'H323-MESSAGES',dec_RasMessage,2}, > {asn1rt,decode,3}| > more]} Hello, I did the following in R7B, and it seems to work fine: > erlc -bper H323-MESSAGES.asn > erl Erlang (BEAM) emulator version 5.0.2.4 [threads] Eshell V5.0.2.4 (abort with ^G) 1> GR = {'GatekeeperRequest',11111,{1,2,3},asn1_NOVALUE,{'TransportAddress',{ipAddress,[[17,13,19,20],5555]}},{'EndpointType',asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,true,false},asn1_NOVALUE,asn1_NOVALUE,[{e164,[35,48,49,50,51,52,53,54,55,56,57,42,44]}],asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE}. {'GatekeeperRequest',11111, {1,2,3}, asn1_NOVALUE, {'TransportAddress',{ipAddress,[[17,13,19,20],5555]}}, {'EndpointType',asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, true, false}, asn1_NOVALUE, asn1_NOVALUE, [{e164,"#0123456789*,"}], asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE} 2> asn1rt:encode('H323-MESSAGES','GatekeeperRequest',GR). {ok,[8,43,102,2,42,3,0,17,13,19,20,21,179,1,0,1,6,0,3,69,103,137,171,193,32]} 3> asn1rt:decode('H323-MESSAGES','GatekeeperRequest',[8,43,102,2,42,3,0,17,13,19,20,21,179,1,0,1,6,0,3,69,103,137,171,193,32]). {ok,{'GatekeeperRequest',11111, {1,2,3}, asn1_NOVALUE, {ipAddress,{'TransportAddress_ipAddress', [17,13,19,20], 5555}}, {'EndpointType', asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, true, false}, asn1_NOVALUE, asn1_NOVALUE, [{e164,"#0123456789*,"}], asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE}} Maybe is not my encoding values enough realistic? I have not done any tests on an unpatched R7B. The version I have used includes an update of the ASN.1 compiler, which will be released as open source in about a week. If you have an Erlang licens it is available for download. > PS Is there any plans for a per_bin option? Yes, we are developing a verion that uses the bit syntax. The plan is to include it in R8. Regards, Bertil -- ------------------------ Bertil Karlsson Ericsson Utvecklings AB Box 1505 SE-125 25 ?lvsj? SWEDEN Phone: +46 8 727 3927 ------------------------ From enano@REDACTED Mon May 21 20:37:55 2001 From: enano@REDACTED (Miguel Barreiro Paz) Date: Mon, 21 May 2001 20:37:55 +0200 (CEST) Subject: config.guess and config.sub are outdated In-Reply-To: <2001-05-21-19-00-54+trackit+sam@inf.enst.fr> Message-ID: Hi, > The current config.guess and config.sub are outdated, and do not allow > Erlang to be built on hppa, s390 or SH versions of Debian GNU/Linux. ...and ARM, please :) (and Alpha, even if it otp doesn't currently work there). Regards, From kent@REDACTED Mon May 21 23:39:19 2001 From: kent@REDACTED (Kent Boortz) Date: 21 May 2001 23:39:19 +0200 Subject: building r7b-2 on solaris In-Reply-To: Bengt Kleberg's message of "Mon, 21 May 2001 18:17:05 +0200 (MET DST)" References: <200105211617.SAA06125@avc280.etxb.ericsson.se> Message-ID: > when doing > ./configure > gmake > on a solaris machine i get the error message > > make[2]: sparc-sun-solaris2.7/Makefile: no such file or directory > > which is true, there is no sparc-sun-solaris2.7 directory. this > directory (with Makefile) is expected by $ERL_TOP/make/run_make.mk > (included by $ERL_TOP/erts/emulator/Makefile). > > Who/When should have created this directory/file? It may be that the configure script failed but didn't stop and report this. Try % ./configure --without-ssl kent From kent@REDACTED Mon May 21 23:41:53 2001 From: kent@REDACTED (Kent Boortz) Date: 21 May 2001 23:41:53 +0200 Subject: config.guess and config.sub are outdated In-Reply-To: Samuel Tardieu's message of "21 May 2001 19:00:54 +0200" References: <2001-05-21-19-00-54+trackit+sam@inf.enst.fr> Message-ID: > The current config.guess and config.sub are outdated, and do not allow > Erlang to be built on hppa, s390 or SH versions of Debian GNU/Linux. > > Could the Erlang maintainers update their copy with the ones found at > http://subversions.gnu.org/cgi-bin/cvsweb/config/ ? This will help spread the > Erlang good words :) They are updated and will be part of otp_src_R7B-3.tar.gz that we are preparing at the moment. It will be out within a week. kent From bruce@REDACTED Tue May 22 01:49:45 2001 From: bruce@REDACTED (Bruce Fitzsimons) Date: Tue, 22 May 2001 11:49:45 +1200 Subject: ASN.1 decoding problems with H.323 References: <064601c0e189$248e0430$5f00a8c0@SLANT> <3B094AE0.270B44F5@uab.ericsson.se> Message-ID: <071d01c0e250$b6ef21c0$5f00a8c0@SLANT> Hi Bertil, thanks for the reply > Maybe is not my encoding values enough realistic? Your example is fine. Thanks for the effort, I should have done the same in my original email. > I have not done any tests on an unpatched R7B. The version I have used > includes an update of the ASN.1 compiler, which will be released as open > source in about a week. If you have an Erlang licens it is available for > download. My version seems to encode okay, but the decode (using your values) fails in the same way as documented in my previous mail: (gk@REDACTED)5> asn1rt:decode('H323-MESSAGES','GatekeeperRequest',[8,43,102,2,42,3,0,17,13,1 9,20,21,179,1,0,1,6,0,3,69,103,137,171,193,32]). {error,{function_clause,[{asn1rt_per_v1,getbit1,[{0,[]}]}, {asn1rt_per_v1,getbits,3}, {asn1rt_per_v1,chars_decode2,5}, {'H323-MESSAGES',dec_AliasAddress,2}, {'H323-MESSAGES', dec_GatekeeperRequest_endpointAlias_components, 4}, {'H323-MESSAGES',dec_GatekeeperRequest,2}, {asn1rt,decode,3}, {erl_eval,expr,3}| more]}} So it seems the original R7B-2 decoder had some problems, and I'm going to stop spelunking the code as its already been fixed :-) > PS Is there any plans for a per_bin option? > Yes, we are developing a version that uses the bit syntax. The plan is to > include it in R8. Great. More speed would be nice :-) Thanks again for your response Bertil, at least I know that it can work - I will be waiting anxiously for the next release. Cheers, Bruce From Chandrashekhar.Mullaparthi@REDACTED Thu May 24 12:15:33 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Thu, 24 May 2001 11:15:33 +0100 Subject: gen_tcp:send Message-ID: <402DD461F109D411977E0008C791C31203919B05@imp02mbx.one2one.co.uk> In the function prim_inet:send/2, kernel-2.6.3.2 send(S, Data) when port(S) -> case catch erlang:port_command(S, Data) of true -> receive {inet_reply, S, Status} -> Status end; {'EXIT', Reason} -> {error, Reason} end. When I'm trying to send some stuff on my socket, erlang:port_command is crashing with the error, {badarg, [{erlang, port_command, [#Port<0.116>, Data]}]}. This seems to indicate that the port is closed. Wouldn't it be a good idea to close the socket in that case and send a tcp_closed message to the controlling process? Chandru NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Chandrashekhar.Mullaparthi@REDACTED Thu May 24 13:20:46 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Thu, 24 May 2001 12:20:46 +0100 Subject: application:stop hangs Message-ID: <402DD461F109D411977E0008C791C31203919B07@imp02mbx.one2one.co.uk> Hi, I need help finding out why my application:stop hangs. I have a supervisor(one_for_one) which has: 5 vanilla gen_servers, {permanent, 2000, worker} 10 workers spawned using proc_lib:spawn by one of the above gen_server. Do not trap exits {transient, brutal_kill, worker} 2 gen_servers which trap_exits but also shutdown when they receive a {'EXIT', Parent, shutdown} message {permanent, 2000, worker} 1 supervisor(simple_one_for_one) which supervises two other vanilla gen_servers {permanent, 5000, supervisor}. Childspec is {transient, 2000, worker} How do I track down the rogue process(es)? tia, Chandru NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Chandrashekhar.Mullaparthi@REDACTED Thu May 24 14:41:51 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Thu, 24 May 2001 13:41:51 +0100 Subject: application:stop hangs Message-ID: <402DD461F109D411977E0008C791C31203919B09@imp02mbx.one2one.co.uk> Right - I did a bit of digging and found that supervisor is hanging in the shutdown(Pid, brutal_kill) function. The reason seems to be that the supervisor did exit(Pid, kill) - but the message {'EXIT', Pid, killed) was only sent to another process to which my worker is linked to! And the supervisor is waiting in this bit of code shutdown(Pid, brutal_kill) -> exit(Pid, kill), receive {'EXIT', Pid, killed} -> ok; {'EXIT', Pid, OtherReason} -> {error, OtherReason} end; Why is it that if a process has links to many processes, only one of them gets the message that this process has been killed?? cheers, Chandru > -----Original Message----- > From: Chandrashekhar Mullaparthi > [mailto:Chandrashekhar.Mullaparthi@REDACTED] > Sent: 24 May 2001 12:21 > To: 'Erlang mailing list' > Subject: application:stop hangs > > > Hi, > > I need help finding out why my application:stop hangs. > I have a supervisor(one_for_one) which has: > > 5 vanilla gen_servers, > {permanent, 2000, worker} > > 10 workers spawned using proc_lib:spawn by one of the above > gen_server. Do > not trap exits > {transient, brutal_kill, worker} > > 2 gen_servers which trap_exits but also shutdown when they receive a > {'EXIT', Parent, shutdown} message > {permanent, 2000, worker} > > 1 supervisor(simple_one_for_one) which supervises two other vanilla > gen_servers > {permanent, 5000, supervisor}. Childspec is {transient, > 2000, worker} > > How do I track down the rogue process(es)? > > tia, > Chandru > > > NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Chandrashekhar.Mullaparthi@REDACTED Thu May 24 16:32:04 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Thu, 24 May 2001 15:32:04 +0100 Subject: application:stop hangs Message-ID: <402DD461F109D411977E0008C791C31203919B0B@imp02mbx.one2one.co.uk> After a bit more digging - there was no link between my worker process and the supervisor!! I was using proc_lib:spawn. I used proc_lib:spawn_link and everything works fine. I had assumed that the supervisor will link to all it's children - it seems to be the other way round. Why does the supervisor not link explicitly - it would be quite handy! cheers, Chandru > -----Original Message----- > From: Chandrashekhar Mullaparthi > [mailto:Chandrashekhar.Mullaparthi@REDACTED] > Sent: 24 May 2001 13:42 > To: 'Erlang mailing list' > Subject: RE: application:stop hangs > > > Right - I did a bit of digging and found that supervisor is > hanging in the > shutdown(Pid, brutal_kill) function. > > The reason seems to be that the supervisor did exit(Pid, > kill) - but the > message {'EXIT', Pid, killed) was only sent to another > process to which my > worker is linked to! And the supervisor is waiting in this bit of code > > shutdown(Pid, brutal_kill) -> > exit(Pid, kill), > receive > {'EXIT', Pid, killed} -> ok; > {'EXIT', Pid, OtherReason} -> {error, OtherReason} > end; > > Why is it that if a process has links to many processes, only > one of them > gets the message that this process has been killed?? > > cheers, > Chandru > > > -----Original Message----- > > From: Chandrashekhar Mullaparthi > > [mailto:Chandrashekhar.Mullaparthi@REDACTED] > > Sent: 24 May 2001 12:21 > > To: 'Erlang mailing list' > > Subject: application:stop hangs > > > > > > Hi, > > > > I need help finding out why my application:stop hangs. > > I have a supervisor(one_for_one) which has: > > > > 5 vanilla gen_servers, > > {permanent, 2000, worker} > > > > 10 workers spawned using proc_lib:spawn by one of the above > > gen_server. Do > > not trap exits > > {transient, brutal_kill, worker} > > > > 2 gen_servers which trap_exits but also shutdown when they receive a > > {'EXIT', Parent, shutdown} message > > {permanent, 2000, worker} > > > > 1 supervisor(simple_one_for_one) which supervises two other vanilla > > gen_servers > > {permanent, 5000, supervisor}. Childspec is {transient, > > 2000, worker} > > > > How do I track down the rogue process(es)? > > > > tia, > > Chandru > > > > > > > > NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From david@REDACTED Fri May 25 00:02:18 2001 From: david@REDACTED (david wallin) Date: Fri, 25 May 2001 00:02:18 +0200 Subject: The Joy of Licenses Message-ID: Hi, The reason for this mail is that I've been thinking of writing glue code to be able to use GSL (http://sources.redhat.com/gsl) from erlang. I didn't get very far because of licensing issues. As far as I can tell, Erlang Public License (EPL) is based on Mozilla (MPL) 1.0 which is incompatible with the GNU GPL, the license used by the GSL people. I guess this means that if I ever get around to write glue code between them, I wont be able to share this with anyone. My question is if I'm correct. If so, perhaps the EPL license could be enhanced to make this possible. If I'm wrong, under what license should the glue code be published ? hope you enjoyed all those acronyms, --david. From etxuwig@REDACTED Fri May 25 12:24:07 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Fri, 25 May 2001 12:24:07 +0200 (MET DST) Subject: application:stop hangs In-Reply-To: <402DD461F109D411977E0008C791C31203919B0B@imp02mbx.one2one.co.uk> Message-ID: On Thu, 24 May 2001, Chandrashekhar Mullaparthi wrote: >After a bit more digging - there was no link between my worker process and >the supervisor!! I was using proc_lib:spawn. I used proc_lib:spawn_link and >everything works fine. > >I had assumed that the supervisor will link to all it's children - it seems >to be the other way round. Why does the supervisor not link explicitly - it >would be quite handy! We've had discussions about this for quite some time. It's not backward compatible, nor does it completely solve the problem, to have the supervisor link to the child automatically. I *have* seen at least one case where the child has explicitly called unlink(Parent) (!). I was told that the reason had to do with some special test method from the Erlang shell(*), and that they had forgotten to take it out... (*) Actually, if you start a gen_server using start_link from the shell, you'd better explicitly unlink it -- if you mistype a command and the shell process crashes (which happens pretty often), your server will die as well. The solution should be to have the supervisor rely on monitors instead of links for the shutdown protocol. I've patched supervisor.erl with the following code. It seems to work for me. /Uffe shutdown(Pid, brutal_kill) -> unlink(Pid), case already_exited(Pid, killed) of false -> exit(Pid, kill), receive {'DOWN', MRef, process, Pid, killed} -> ok; {'DOWN', MRef, process, Pid, OtherReason} -> {error, OtherReason} end; Other -> % ok | {error, ErrorReason} Other end; shutdown(Pid, Time) -> unlink(Pid), case already_exited(Pid, shutdown) of false -> exit(Pid, shutdown), receive {'DOWN', MRef, process, Pid, shutdown} -> ok; {'DOWN', MRef, process, Pid, OtherReason} -> {error, OtherReason} after Time -> exit(Pid, kill), %% Force termination. receive {'DOWN', MRef, process, Pid, OtherReason} -> {error, OtherReason} end end; Other -> % ok | {error, ErrorReason} Other end. already_exited(Pid, ExpectedReason) -> receive {'DOWN', MRef, process, Pid, ExpectedReason} -> ok; {'DOWN', MRef, process, Pid, OtherReason} -> {error, OtherReason} after 0 -> false end. -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From luke@REDACTED Fri May 25 12:51:02 2001 From: luke@REDACTED (Luke Gorrie) Date: 25 May 2001 12:51:02 +0200 Subject: application:stop hangs In-Reply-To: References: Message-ID: Ulf Wiger writes: > (*) Actually, if you start a gen_server using start_link from the > shell, you'd better explicitly unlink it -- if you mistype a > command and the shell process crashes (which happens pretty > often), your server will die as well. This bites me all the time. The thought occurs that adding an "always 'catch'" mode to the shell could be a really good hack. -Luke From lennart.ohman@REDACTED Fri May 25 13:23:21 2001 From: lennart.ohman@REDACTED (Lennart =?iso-8859-1?Q?=D6hman?=) Date: Fri, 25 May 2001 13:23:21 +0200 Subject: application:stop hangs References: Message-ID: <3B0E40A9.5F0BD53E@st.se> Taking a risk when entering into a correspondence I have not followed... In the first place proc_lib was (a long time ago) built as a layer between gen_server (or server_lib at that time) for those who needed to build (OTP)compliant processes but without using server_lib. At that time there were no gen_event, gen_fsm etc. At that time there were no applications-concept making it sometimes necessary to start processes as top-most-supervisor linked to nothing. If you like the spawning and linking to be atomic it must be done through a call to spawn_link/3. Since having all API functions (including the start function) in the code which implements the server is a really good idea, it must be the server code which calls spawn_link/3 (instead of making it the responsibility of the supervisor to link). Then there must be two gen_server or proc_lib functions to provide both options (unlinked for shell testing or other situations where linking to the caller is no good, and regular linked). You must just hope that the server programmer uses the correct one for the situation the server is going to be started in. /Lennart Ulf Wiger wrote: > > On Thu, 24 May 2001, Chandrashekhar Mullaparthi wrote: > > >After a bit more digging - there was no link between my worker process and > >the supervisor!! I was using proc_lib:spawn. I used proc_lib:spawn_link and > >everything works fine. > > > >I had assumed that the supervisor will link to all it's children - it seems > >to be the other way round. Why does the supervisor not link explicitly - it > >would be quite handy! > > We've had discussions about this for quite some time. It's not > backward compatible, nor does it completely solve the problem, to > have the supervisor link to the child automatically. I *have* > seen at least one case where the child has explicitly called > unlink(Parent) (!). I was told that the reason had to do with > some special test method from the Erlang shell(*), and that they > had forgotten to take it out... > > (*) Actually, if you start a gen_server using start_link from the > shell, you'd better explicitly unlink it -- if you mistype a > command and the shell process crashes (which happens pretty > often), your server will die as well. > > The solution should be to have the supervisor rely on monitors > instead of links for the shutdown protocol. > > I've patched supervisor.erl with the following code. > It seems to work for me. > > /Uffe > ------------------------------------------------------------- Lennart Ohman phone : +46-8-587 623 27 Sjoland & Thyselius Telecom AB cellular: +46-70-552 6735 Sehlstedtsgatan 6 fax : +46-8-667 8230 SE-115 28 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED From her@REDACTED Fri May 25 15:14:45 2001 From: her@REDACTED (Helmut Enck-Radana) Date: Fri, 25 May 2001 15:14:45 +0200 Subject: The Joy of Licenses Message-ID: <5.0.2.1.0.20010525151415.00a5cb10@popmail.space.net> In case anyone who needs to know about open source licensing issues isn't aware of the available resources: There is an explanation of various license models from the view of the FSF on their site: http://www.gnu.org/philosophy/license-list.html And the natural language explanation of the EPL is here: http://www.erlang.org/license/EPL1x0-explained.html >The reason for this mail is that I've been thinking of writing glue code >to be able to use GSL (http://sources.redhat.com/gsl) from erlang. I >didn't get very far because of licensing issues. > >As far as I can tell, Erlang Public License (EPL) is based on Mozilla >(MPL) 1.0 which is incompatible with the GNU GPL, the license used by the >GSL people. >I guess this means that if I ever get around to write glue code between >them, I wont be able to share this with anyone. > >My question is if I'm correct. If so, perhaps the EPL license could be >enhanced to make this possible. >If I'm wrong, under what license should the glue code be published ? If there was a problem, it could be solved by publishing Erlang under the GPL and the EPL as well. But I don't think there is a problem as long as you don't reuse and modify sources which are under the EPL. (That's my personal opinion, and I'm not a lawyer.) If you have to reuse EPLed code, then there could be a problem. The EPL doesn't force you to publish your whole derived work under the EPL, only the reused EPLed code remains covered by the EPL. But the problem here is (as far as I can see) that any modifications of this code have to be reported to Ericsson, and you have to give credit to them (paragraph 3.3). The GPL on the other side forces you to apply the GPL to the whole derived work if you publish it, and requires you not to add any additional constraints on the reuse of the code. Possibly paragraph 4 of the EPL can be used to solve this conflict? (A clarification from Ericsson's side would be useful here.) In fact there is already work which is based on code under the EPL and has been published under the GPL, e.g. http://www.idealx.org/prj/idx-xmnesia. I cannot imagine that it is intended by Ericsson or the FSF to prevent you from publishing your work. That would be contrary to the idea of Open Source, wouldn't it. -- Helmut From aa@REDACTED Mon May 28 14:22:28 2001 From: aa@REDACTED (Adam Aquilon) Date: Mon, 28 May 2001 14:22:28 +0200 Subject: EXIT messages from sockets...? Message-ID: <09c801c0e770$dc64a270$072a010a@cellpt.se> Hi all, Does anyone know if Socket processes can send EXIT signals to their owners, and if so, what kind of messages that may be sent? Also, under which circumstances can a listening port be closed by the Erlang VM or the OS? Background: I have a server listening to a TCP port (i.e. owns a listening socket). The server spawns off processes handling each new client that connects to this port in the standard, time-honored fashion. Sometimes, usually during high load it seems, the server that owns the listening socket gets a message looking like this: {'EXIT',#Port,normal} After this, the port is closed (note that it *can* be reopened successfully). I've seen that some pieces of kernel code seem to guard against this kind of thing happning, for instance in inet_db.erl: handle_info({'EXIT', Socket, _}, State) when port(Socket) -> ets:delete(inet_db, {socket,Socket}), {noreply, State}; But the documentation doesn't seem to mention that such things can happen. Any light shed over this behaviour will be appreciated. Regards, Adam Aquilon From jouni.ryno@REDACTED Mon May 28 22:46:00 2001 From: jouni.ryno@REDACTED (Jouni Ryno) Date: Mon, 28 May 2001 23:46:00 +0300 Subject: Erlang behind firewall(s) (which ports do I need) Message-ID: Which ports need to be open for erlang nodes to talk with each other ? Just 4369 ? I somehow taught it to be easier to make separate erlang-nodes as repeaters, than making point-to-point tunnels over three different networks combining ISDN, firewalled company network and home. But as always, firewall hits me, so I need to be friends with sysadmins ... Jouni Ryn? mailto://Jouni.Ryno@REDACTED/ http://www.geo.fmi.fi/~ryno/ Finnish Meteorological Institute http://www.fmi.fi/ Geophysical Research http://www.geo.fmi.fi/ P.O.BOX 503 Tel (+358)-9-19294656 FIN-00101 Helsinki FAX (+358)-9-19294603 Finland priv-GSM (+358)-50-5302903 "It's just zeros and ones, it cannot be hard" From klacke@REDACTED Tue May 29 08:52:11 2001 From: klacke@REDACTED (Klacke) Date: Tue, 29 May 2001 08:52:11 +0200 Subject: Erlang behind firewall(s) (which ports do I need) In-Reply-To: ; from jouni.ryno@fmi.fi on Mon, May 28, 2001 at 11:46:00PM +0300 References: Message-ID: <20010529085211.A15642@bluetail.com> On Mon, May 28, 2001 at 11:46:00PM +0300, Jouni Ryno wrote: > Which ports need to be open for erlang nodes to talk with each other ? > Just 4369 ? > > I somehow taught it to be easier to make separate erlang-nodes as > repeaters, than making point-to-point tunnels over three different > networks combining ISDN, firewalled company network and home. But as > always, firewall hits me, so I need to be friends with sysadmins ... > > This can't be done just now. The problem is that when a node starts, it binds to a dynamically allocated port, get's the port num and then tells epmd which portnum it got. An extension is needed whereby it's possible to tell inet_tcp_dist.erl (in the kernel app) that it should specifically listen() to an explicit port as opposed to 0, which means "allocate dynamically" Maybe something like: listen(Name) -> case inet_tcp:listen(get_p_num(), [{active, false}, {packet,2}]) of {ok, Socket} -> TcpAddress = get_tcp_address(Socket), {_,Port} = TcpAddress#net_address.address, {ok, Creation} = erl_epmd:register_node(Name, Port), {ok, {Socket, TcpAddress, Creation}}; Error -> Error end. get_p_num() -> case application:get_env(kernel, distport) of {ok, Pno} -> Pno; _ -> 0 end. and start as for example: > erl -sname abc -kernel distport 7843 /klacke -- Claes Wikstrom -- Caps lock is nowhere and Alteon WebSystems -- everything is under control http://www.bluetail.com/~klacke -- From enano@REDACTED Tue May 29 11:02:19 2001 From: enano@REDACTED (Miguel Barreiro Paz) Date: Tue, 29 May 2001 11:02:19 +0200 (CEST) Subject: Erlang behind firewall(s) (which ports do I need) In-Reply-To: <20010529085211.A15642@bluetail.com> Message-ID: > This can't be done just now. The problem is that when a node starts, > it binds to a dynamically allocated port, get's the port num and By the way, has anyone looked at "kerberizing" Erlang? I mean, using Kerberos authentication instead of the magic cookies. Regards, Miguel From nico.weling@REDACTED Thu May 31 09:23:12 2001 From: nico.weling@REDACTED (Nico Weling) Date: Thu, 31 May 2001 09:23:12 +0200 Subject: How to set up a ppp conection with erlang? Message-ID: <3B15F160.724DE011@eed.ericsson.se> Hi Erlang Users, does anybody know how to setup a ppp conection over the ttySx port with Erlang? Best regards, Nico. From jamesh@REDACTED Thu May 31 17:09:15 2001 From: jamesh@REDACTED (James Hague) Date: Thu, 31 May 2001 10:09:15 -0500 Subject: Binaries in R8 Message-ID: Does anyone on the Erlang team know what's changing--if anything--in relation to binaries for R8? Mostly I'm hoping to see some real support for little-endian matching, as the "/little" qualifier is fairly ambiguous and/or broken (i.e. what does it mean to say that a bitfield is little endian, if you can't specify that an entire word is little endian?). Several times now I've been wanting to write code to pick apart and create binary files, but if those files are little endian internally, then it is much more difficult. Binaries are so beautiful otherwise! James From peter@REDACTED Thu May 31 20:52:59 2001 From: peter@REDACTED (Peter H|gfeldt) Date: Thu, 31 May 2001 20:52:59 +0200 (MET DST) Subject: Strange behaviour with SSL In-Reply-To: <3B16783D.C5E2B756@ericsson.com> Message-ID: On Thu, 31 May 2001, Marcus Shawcroft wrote: > Hi. > Ive got R7B-2 on a Redhat 7.1 intel box. The following test code: > > test () -> > ssl:start (), > {ok,S} = ssl:listen (5044, []), > ssl:accept (S). > > returns {error, ebadf} > > which isnt what I had expected...... > > I turned debugging on in the ssl application and noted that the > ssl_esock program was complaining > [ERROR_ACCEPT= fd = 5, flags = > ERROR: flags empty > > > Is this a known problem, and is there a fix? Yes, have at least one option in listen(Port, Options) :-). The error code is indeed quite cryptic in this case, but the idea is that not providing any options at all to listen/2, will eventually result in an error. /Peter ------------------------------------------------------------------------- Peter H?gfeldt e-mail : peter@REDACTED Open Telecom Platform Ericsson Utvecklings AB