From shrogers@REDACTED Sat Feb 1 01:49:20 2003 From: shrogers@REDACTED (steve@shrogers.com) Date: Fri, 31 Jan 2003 16:49:20 -0800 (PST) Subject: {error,sticky_directory} Message-ID: <7487496.1043991943114.JavaMail.nobody@wamui02.slb.atl.earthlink.net> When compiling the sets.erl example in "Concurrent Programming in Erlang" I get this error: Erlang (BEAM) emulator version 5.2 [source] [hipe] Eshell V5.2 (abort with ^G) 1> c(sets.erl). {error,sticky_directory} =ERROR REPORT==== 30-Jan-2003::22:52:02 === Can't load module that resides in sticky dir 2> What is this telling me? I might guess that the module is the one I'm trying to compile and sticky directory is the current directory. Rgds, Steve From shrogers@REDACTED Sat Feb 1 03:30:27 2003 From: shrogers@REDACTED (steve@shrogers.com) Date: Fri, 31 Jan 2003 18:30:27 -0800 (PST) Subject: {error,sticky_directory} Message-ID: <7651799.1043998009601.JavaMail.nobody@wamui01.slb.atl.earthlink.net> My thanks to Vance and Bengt. Erlang is interesting, but does have its share of quirks. Steve From erlang@REDACTED Sat Feb 1 11:00:27 2003 From: erlang@REDACTED (Inswitch Solutions - Erlang Evaluation) Date: Sat, 1 Feb 2003 11:00:27 +0100 Subject: Fw: OTP vs. non-OTP Message-ID: <005001c2c9d8$c03e1c10$1e00a8c0@design> My humble opinion as a newbie in Erlang. In favour of reusability, Design Patterns (like OTP behaviours) resolve common tasks in the very start of the Design phase and before implementation phase. Should I invest time to learn OTP (patterns)? Having one problem if the time to resolve it is less than learning about patterns, I'd say no. Now I do, because there are few patterns to learn and to resolve more than one common repeatitive problem. In my case, telecom. The question is how much difficult to learn will become Erlang when more patterns will be added ? Furthermore, how can knowledge be transfered in the best way ? Is it always a matter of time and Design Patterns the media ? Eduardo Figoli INSwitch Solutions > ----- Original Message ----- > From: "Martin Bjorklund" > To: > Cc: > Sent: Friday, January 31, 2003 1:44 PM > Subject: Re: OTP vs. non-OTP > > > > "Joakim G." wrote: > > > > > 2) Only a handful of people seems to be able to grasp all what OTP has > > > to offer. > > > > So is this a problem? I don't grasp all of OTP (e.g. I know nothing > > about Corba). Does that make OTP a bad thing? How many people > > understand (or even know) everything in libc, and they still use it. > > > > > > > We should probably not burden the erlang-questions lists with further > > > discussions about this. > > > > All right; in your office... :) > > > > > > /martin > From Helmut.Heinze@REDACTED Sat Feb 1 01:48:07 2003 From: Helmut.Heinze@REDACTED (Helmut Heinze) Date: Sat, 01 Feb 2003 11:48:07 +1100 Subject: OTP vs. non-OTP (was: A Joeish Erlang distribution (long)) In-Reply-To: <20030131.105401.70223322.mbj@bluetail.com> References: <3E37A400.8040809@erlang-consulting.com> <20030129111836.C27679@bluetail.com> <3E3A381C.4050502@bluetail.com> <20030131.105401.70223322.mbj@bluetail.com> Message-ID: <5eadhgygfs.fsf@sunset.textwerk.priv> Dear Erlang/OTP experts, working in a completely different field (model-based 'theory of social systems') and developing an IT-based modelling framework that implements among other things an online CMS, I have taken to the 'T' in OTP as an extremely versatile metaphor for general, machine-aided social (tele-)communication of _any_ kind. After years of tinkering in C++ and Java and a bit of Lisp I switched to Erlang, with an increasing emphasis on OTP and its design principles -- and now it seems that I am slowly getting somewhere. The rigid, well-documented OTP framework has proven to be most helpful. Thanks to all on this list for the extremely professional and insightful discussions, it taught me OTP in the past 2 years. Helmut -- Dr. Helmut Heinze School of Languages, Cultures & Linguistics German Studies Programme Monash University PO Box 11A Victoria 3800 Australia Phone: +61 (3) 9905 8391 FAX: +61 (3) 9905 5251 From happi@REDACTED Sat Feb 1 01:57:33 2003 From: happi@REDACTED (Happi) Date: Sat, 1 Feb 2003 01:57:33 +0100 Subject: warn_unused_vars References: Message-ID: <001701c2c98c$e7bfdb30$0100a8c0@LISA> I think Richard C. or Bj?rn G. can explain this better... ... but I'll give it a try, and they can fill in the blanks and correct my errors. The problem comes from the order in which things are done in the compiler. The compile options in the file are not parsed until after the linter is executed -- hence the linter will not see the warn_unused_vars flag. To get around this problem I have set ERL_COMPILER_OPTIONS to '[warn_unused_vars,nowarn_shadow_vars]' in my unix-shell. There are several strange things with the order in which the compiler does things, and the fact that you can give compiler options in several different places, but that let's not start that thread, nor the thread about the linter and the macro expander. -Erik -------------------------------------- I'm Happi, you should be happy. Praeterea censeo "0xCA" scribere Erlang posse. ----- Original Message ----- From: "Ulf Wiger" To: Sent: Friday, January 31, 2003 5:11 PM Subject: warn_unused_vars > > Can someone explain this? > > 1> c(leader). > {ok,leader} > 2> leader:module_info(compile). > [{options,[v3,warn_unused_vars]}, > {version,"4.1.1"}, > {time,{2003,1,31,16,5,57}}] > 3> c(leader,[warn_unused_vars]). > ./leader.erl:126: Warning: variable 'From' is unused > {ok,leader} > 4> leader:module_info(compile). > [{options,[v3,warn_unused_vars,warn_unused_vars]}, > {version,"4.1.1"}, > {time,{2003,1,31,16,6,16}}] > > > That is, I've added '-compile(warn_unused_vars)' in the > source code, but the linter seems to ignore that. With > module_info, I can see that the compile option is there. I > don't get any warning unless I add 'warn_unused_vars' as an > explicit option to compile, though. > > I looked briefly at compile.erl, but I'd rather that someone > who knows the code take a look. It's not the simplest module > in the OTP distribution. > > > This is compiler-4.1.1 (OTP R9B) > > /Uffe > -- > Ulf Wiger, Senior Specialist, > / / / Architecture & Design of Carrier-Class Software > / / / Strategic Product & System Management > / / / Ericsson Telecom AB, ATM Multiservice Networks > > From kent@REDACTED Sat Feb 1 01:52:36 2003 From: kent@REDACTED (Kent Boortz) Date: 01 Feb 2003 01:52:36 +0100 Subject: OTP vs. non-OTP In-Reply-To: <20030131224724.GA227@frogman.motivity.ca> References: <20030131165152.GJ28236@frogman.motivity.ca> <200301312224.h0VMO1411082@bonsai.fernuni-hagen.de> <20030131224724.GA227@frogman.motivity.ca> Message-ID: Vance Shipley writes: > The URLs are: > http://www.erlang.org/doc/r9b/doc/system_principles/part_frame.html > http://www.erlang.org/doc/r9b/doc/design_principles/part_frame.html > http://www.erlang.org/doc/r9b/doc/oam/part_frame.html It can also be worth reading the additional documentation on how code replacement works together with the applications, generic behaviours and supervision support in OTP http://www.erlang.org/doc/misc/ kent From kent@REDACTED Sat Feb 1 02:18:11 2003 From: kent@REDACTED (Kent Boortz) Date: 01 Feb 2003 02:18:11 +0100 Subject: A Joeish Erlang distribution (long) In-Reply-To: <5F03ACA2F76DD411B8BC00508BE3B4D71200F705@esemont203.gbg.edt.ericsson.se> References: <5F03ACA2F76DD411B8BC00508BE3B4D71200F705@esemont203.gbg.edt.ericsson.se> Message-ID: "Vlad Dumitrescu (EAW)" writes: > another reason for which the distribution structure would benefit > from being revised (with ot without repackaging, but more so with) > is that the build process will have to be revisited too. Cleaning up > all dependencies and generally streamlining the Makefiles would make > life much easier for maintainance. Several former members in the OTP team tried to "rewrite the build support from scratch to something much better" and failed. I think improving it step by step is the best approach. We are very thankful for the portability patches and dependency corrections we get from members of this list. The dependency rules are really bad. The reason they don't improve much from release to release is that when we develop interactively we are working in ClearCase (a commercial big brother to CVS). It uses its own file system and make command that keep track of (almost) all the dependencies between files so basically we don't notice that we use broken make files. For the daily build of the OpenSource Erlang OTP we always build from scratch and this doesn't really test that the dependency rules are correct, just that they are correct enough to build from scratch. > Not to mention that it might make possible to build on Cygwin! ;-) A native Cygwin build is being worked on, it is improving nicely but I can't say when it will be ready, kent From valentin@REDACTED Sat Feb 1 08:40:01 2003 From: valentin@REDACTED (Valentin) Date: Sat, 1 Feb 2003 09:40:01 +0200 Subject: OTP vs. non-OTP References: <005001c2c9d8$c03e1c10$1e00a8c0@design> <20030131165152.GJ28236@frogman.motivity.ca> Message-ID: <00aa01c2c9c5$330597a0$d2b01fc4@moneymaker> > On Sat, Feb 01, 2003 at 11:00:27AM +0100, Eduardo Figoli wrote: > } > } Should I invest time to learn OTP (patterns)? > > By all means. > Initially, I've tried to do it all by myself -- as a matter of fact I've been saying, Erlang is great, but OTP sucks. Fear of unknown, I suppose... and a little bit of arrogance (nobody will tell ME how to do MY stuff!). So, my first commercial-like app was written without using behaviors and -- VERY BADLY, I must add. I was not able to understand the code that I wrote only few weeks earlier. The second iteration of the same app, that I had to do only two months after official launch (and guess why -- worst thing I've ever wrote, and I did some horrible stuff in my life) has been restructured using/following DESIGN PRINCIPLES. A weekend later, I saw the light at the end of the tunnel... listening to all these discussions makes me wonder -- could that be a runaway train heading my way? Whatever. Life is good now. Look, maybe one HAS to go to the bottom of the Adriatic Sea to find out that wasn't really necessary. After all, expert is a person that made all the mistakes in a specific field, right? V. From seb@REDACTED Sat Feb 1 10:25:06 2003 From: seb@REDACTED (Sebastian Strollo) Date: 01 Feb 2003 01:25:06 -0800 Subject: {error,sticky_directory} In-Reply-To: <1542252.1044083064231.JavaMail.nobody@wamui04.slb.atl.earthlink.net> References: <1542252.1044083064231.JavaMail.nobody@wamui04.slb.atl.earthlink.net> Message-ID: <4ww7kckuzd9.fsf@locke.strollo.org> "steve@REDACTED" writes: > I suspect that the error messages are crystal clear to those who > really understand Erlang. Not always, no... :-) > The rest of us need that magic decoder ring. The closest to describing this particular problem you will find in the "man" page for the "code" module under the stick_dir/1 function. (If you have installed an Erlang system and man pages you can view it with "erl -man code"). But I guess the harder question is, how would you know where to look in the first place... A cross reference for error messages would be good I guess... Cheers, /Sebastian From matthias@REDACTED Sat Feb 1 10:56:10 2003 From: matthias@REDACTED (Matthias Lang) Date: Sat, 1 Feb 2003 10:56:10 +0100 Subject: {error,sticky_directory} In-Reply-To: <1542252.1044083064231.JavaMail.nobody@wamui04.slb.atl.earthlink.net> References: <1542252.1044083064231.JavaMail.nobody@wamui04.slb.atl.earthlink.net> Message-ID: <15931.39354.301574.280840@antilipe.corelatus.se> steve@REDACTED writes: > It was obvious to me that the the error message should mean > something, but that I needed a magic decoder ring. > Is there such a thing? I know of three magic decoder rings. Google: punching {error,sticky_directory} into google gives you four pages. Three of them answer the question. More generally, you can do wonders with a site-specific google search (include "site:www.erlang.org", either manually or with a bit of HTML) The manual index: if you look under 'sticky' you get to the right man page. You still need to search for 'sticky' within that page. http://www.erlang.org/doc/r9b/doc/index.html The mailing list: it's a perfect question for the mailing list. ;-) After some prodding, I've added an entry to the FAQ about sticky directories. It'll appear on the WWW in a month or two. Matthias From klacke@REDACTED Sat Feb 1 13:41:52 2003 From: klacke@REDACTED (Klacke) Date: Sat, 1 Feb 2003 13:41:52 +0100 Subject: warn_unused_vars In-Reply-To: <001701c2c98c$e7bfdb30$0100a8c0@LISA>; from happi@home.se on Sat, Feb 01, 2003 at 01:57:33AM +0100 References: <001701c2c98c$e7bfdb30$0100a8c0@LISA> Message-ID: <20030201134152.A5768@bluetail.com> On Sat, Feb 01, 2003 at 01:57:33AM +0100, Happi wrote: > I think Richard C. or Bj?rn G. can explain this better... > ... but I'll give it a try, and they can fill in the blanks > and correct my errors. > > > The problem comes from the order in which things are done > in the compiler. > > The compile options in the file are not parsed until > after the linter is executed -- hence the linter > will not see the warn_unused_vars flag. > > To get around this problem I have set > ERL_COMPILER_OPTIONS > to > '[warn_unused_vars,nowarn_shadow_vars]' > in my unix-shell. Excellent, I've had problems with this as well but never had the energy to investigate. Furthermore, I warmly recommend the readers of this list to start using these warn messages from the compiler. It has saved me lots of boring debugging work. /klacke -- Claes Wikstrom -- Caps lock is nowhere and Alteon WebSystems -- everything is under control http://www.bluetail.com/~klacke cellphone: +46 70 2097763 From joe@REDACTED Sat Feb 1 20:02:41 2003 From: joe@REDACTED (Joe Armstrong) Date: Sat, 1 Feb 2003 20:02:41 +0100 (CET) Subject: OTP vs. non-OTP In-Reply-To: <20030131165152.GJ28236@frogman.motivity.ca> Message-ID: On Fri, 31 Jan 2003, Vance Shipley wrote: > On Sat, Feb 01, 2003 at 11:00:27AM +0100, Eduardo Figoli wrote: > } > } Should I invest time to learn OTP (patterns)? > > By all means. > > As has been said here before the sequence of events should be like this: > > 1) write small example programs using just Erlang > > 2) write real applications using generic behaviors and if > appropriate supervision, application, OAM, etc. > > 3) spend years being happily productive > > 4) become purist and write/rewrite your own frameworks > The whole point of OTP was to capture common usage patterns in modules - forget about the *actual* gen_server and look at the pattern: Here is a mini gen server rpc(Pid, Q) -> Pid ! {self(), Q}, receive {Pid, Reply} -> Reply end. loop(State, Fun) -> receive {swapCode, Fun1} -> loop(State, Fun1); {From, Q} -> {Reply, State1} = Fun(Q, State), From ! {self(), Reply}, loop(State1) end. This is the *basic* model for all gen_servers: This particular one allows you to hot swap the code in the server. One you understand the basic *structure* it's easy to "roll your own" Here's one that crashes the client if the quert in the server results in a crash: rpc(Pid, Q) -> Pid ! {self(), Q}, receive {ok, Pid, Reply} -> Reply; {oops, Pid, Why} -> exit(Why) end. loop(State, Fun) -> receive {swapCode, Fun1} -> loop(State, Fun1); {From, Q} -> case (catch Fun(S,State)) of {'EXIT', Why} -> From ! {opps, self(), Why}, loop(State); {Reply, State1} -> From ! {ok, self(), Reply}, loop(State1) end end. This one gives you "transaction semantics" in the server - i.e. it loops with State is the transaction failed, ok State1 if it worked. Note that *once you have understood the basic idea* (which is pretty simple) - all the rest follows naturally. This explains my earlier posting - I *always* roll my own - as you can see from the previous examples this is pretty easy. The gen_server is just a *particular set of choices* for error-trapping, code swapping etc. - we hoped it would be generally useful - but it is *not* a universal panicea. Stick with the underlying patterns and you'll end up writing much prettier code Moral: *understand* the basic patterns involved and then "roll you own" for the problem domain in question. /Joe > > If you're writing a filter or file parser or tax calculator then keep > it simple and just write some Erlang. If you're writing an application > which is going to be turned on and run for a while like an SMTP daemon, > web server, instant messaging server, directory server, etc. then use > the design principles and package and run it as an embedded system (*). > > -Vance > > (*) until you have reached 4 in above > From mbj@REDACTED Sat Feb 1 22:12:13 2003 From: mbj@REDACTED (Martin Bjorklund) Date: Sat, 01 Feb 2003 22:12:13 +0100 (CET) Subject: OTP vs. non-OTP In-Reply-To: <20030131234719.A18813@bluetail.com> References: <3E3A381C.4050502@bluetail.com> <20030131.105401.70223322.mbj@bluetail.com> <20030131234719.A18813@bluetail.com> Message-ID: <20030201.221213.74729033.mbj@bluetail.com> Klacke wrote: > On Fri, Jan 31, 2003 at 10:54:01AM +0100, Martin Bjorklund wrote: > > Klacke wrote: > > > > > >>You would not divide the processes into behaviors? > > > > > > > > > > > > Nope > > > > Oh yes you would and you even do that. > > > > Actually I don't even know what a behavior is. If I do indeed > " divide the processes into behaviors" it is entirely by > accident. > > > So, what is an OTP behaviour ? All right, I'll pick it up :) There are 5 OTP behaviours, gen_server, gen_fsm, gen_event, supervisor and application. You can also define your own behaviour, but these 5 are included in OTP. [I know you use gen_server; you even wrote one of it's predecessors (you know, the one with the fantastic name 'generic')!] The idea is that *if* you know that the process you're about to write matches one of the behaviours, you should use that behaviour. If you need something else, fine by me, OTP just provides you with these behaviours, and hope that you'll find them useful and use them. And as Joe said, the behaviours are no rocket-science; the basic idea behind each behaviour is super-simple - Joe wrote the gen_server one, here'e the gen_event: send_event(Pid, Event) -> Pid ! {event, Event}. register(Pid, F) -> Pid ! {register, F}. loop(Funs) -> receive {register, Fun} -> loop([Fun | Funs]); {event, Event} -> lists:foreach(fun(F) -> F(Event) end, Funs), loop(Funs) end. So, an error_logger process could have one fun that writes to the tty, one that writes to a file and one that sends the msg to a syslog server. And it's very easy to add another one that sends an SNMP notification for some events without modifying the existing code. Now, by using the OTP behaviours you get a lot of things for free, e.g. it fits into the OTP concept of an application which can be used to make your code easily integrated into other peoples projects, it's pretty well-tested, it reduces your code size, it's easier to read by other people that know this behaviuor (than pure erlang code with ! and receive (of course a statement like 'easy to read' is very subjective, but I think most people agree), and it's easier to debug. E.g. when I need to debug one of our installed systems, I know that I can do sys:get_status(Pid) even if the process is written by you or jocke :) to get the internal state of the process. And I know I can do sys:trace() (ok, it's not as important now when we have the trace support in the emulator as it used to be) to see how a specific message changes the state of a process. To summarize, if you're relatively new to erlang and you don't really know if you should use a behaviour or not, you should use it (*). If you know what you're doing, and would like to be "OTP-compliant", use ! and receive as you like, and use the proc_lib(3) and sys(3) to handle system messages. Otherwise, do whatever you like. (*) I know that I would _never_ follow such an advice. I need to make my own mistakes first :) /martin From jay@REDACTED Sat Feb 1 23:31:39 2003 From: jay@REDACTED (Jay Nelson) Date: Sat, 01 Feb 2003 14:31:39 -0800 Subject: Why erlang is the best language for the Internet Message-ID: <4.2.2.20030201142937.00cf5310@duomark.com> In my last posting I made the following bald statement: > The OO straight-jacket is a major hindrance to web-based computing This is a general observation I've made that I haven't seen discussed much. The Internet introduced, and is furthering, disconnected distributed computation. It operates by passing stateless messages and requiring sender and receiver to reconstruct and reproduce an environment to synchronize their states. Manufacturers are pushing multiple servers, multi-CPU machines and fast networks to handle all the messaging. Object-oriented programming assumes a global environment in which all objects live and communicate with each other, a life-cycle for objects, and generally static typing enforced by the compiler. Objects / languages end up having to bolt on some incredibly arcane and complicated way of streaming themselves for reproduction on another node (e.g., marshalling, XML, and CORBA). When they arrive on the new node, they find themselves teleported to another dimension where they can't breathe the prevalent atmosphere without goggles, helmet, and vacuum assist pack. It seems to me that the Internet and programming languages are going in opposite directions. Concurrent, message-based languages are better for implementing Internet capabilities because they inherently mirror the structure of the Internet. Why is this happening? My only answer is that the Internet allows computers to be manufactured cheaply because they are interchangeable and so the manufactures push the appliance / separation concept as far as they can. The HTML / XML standardization allows Sunday programmers the ability to interface systems because they can just grab some heavy, slow script off the net that does the work for them without having to design anything. OO is a hold over from trying to improve the big iron / big software project days which never considered being relocated to another machine. Because of the training required, languages are less likely to change if corporations (and tool developers) are trying to protect their installed base. The continued push in the OO direction is because 1) there is a lot of momentum so it won't slow for a while, and 2) the failures have been associated with programming in general, or programming teams in general, rather than the language approach. The fact that universities (in the US at least) nowadays tend to give a CS degree to a student who has only studied one language (C++ or Java) has definitely led to a language resistence. The programmer who says "that's the last new language I will learn", is already retired. Even if I don't use a new language, I can guarantee that I will adapt some of the concepts to the languages I do use. I think erlang needs to point out this discrepancy to gain momentum. Even though it is over 10 years old, it was designed with the network in mind, with concurrency and message-passing as its central tenet, and with the elegance and clarity that makes for a superior language. jay From jay@REDACTED Sat Feb 1 23:10:00 2003 From: jay@REDACTED (Jay Nelson) Date: Sat, 01 Feb 2003 14:10:00 -0800 Subject: Why I chose erlang (very, very long story) Message-ID: <4.2.2.20030201140630.00cec200@duomark.com> I've been following the discussions about OTP the past few days and found the comments by various participants particularly enlightening. It's always nice to observe a lively discussion -- so much can be learned. I thought I'd throw in my opinions as to why I am using erlang. I hope they are useful to someone, especially the Ericsson Product Manager. My background is rather varied having started with Basic, assembler and RPG, before moving on to APL, Prolog, Pascal, Forth, Smalltalk-80, Modula-2 (on the Lilith), then those halcyon days of Symbolics LISP with Flavors & Z-macs (an editor without meta-, hyper-, and super- seems so limited), Expert Systems and other AI techniques, a rude introduction to C on Sun (why is this new concept of memory allocation necessary?), followed by C++, OODBs, CLOS with MOP (MOP being the main reason why OO was so interesting in the first place -- why, oh why, was it eliminated in future OO languages, just to allow mere mortals with no passion for programming to have access to the Gospel?), Perl, Javascript, Java, Python, Ruby (now that is a fine OO language for small problems) and now erlang. I am first and foremost a language dilettante, but when I find one that is useful I work with it to discover what is different about it and in what situations it might apply. I have written small things (compared neural net implementations in Pascal, spreadsheet macros and APL, a mini-SECD machine in assembler on TRS-80) to large things (traditional business/banking/manufacturing inventory/accounting/personnel systems, aerospace message-based OODB applications, a Perl program that automatically loaded a structured database from English text free-formatted OCRed resumes) to Internet things (webserver / gameserver, meta-search tools, html generators, data extraction systems). Unfortunately, a job often dictates the language and the problem so my useful efforts have been limited. My observations about languages: 1) Spend a little time evaluating and toss quickly those that you don't like 2) Toy problems are designed to make a language look good or to point out its strongest features 3) Fiddling with your own toy problems highlights issues of a language relevant to your use of it 4) Until you implement a real problem you can't understand the language 5) Until you hit the limits of applicability you aren't proficient in a language 6) A language will subliminimally and fundamentally alter your perception of a problem 7) Don't believe the hype 8) The proper or improper design of data structures can make a problem range from trivial to unsolvable; ease of expressing and redesigning data structures is essential to solving real problems #6 is most apparent if you compare any combination of a functional language, imperative language, constraint-base language, rule-based language, OO language, dataflow lnaguage, pattern-based language or any other paradigm to the same problem. Another easy way to see #6 is to discover the right language for a problem, solve it elegantly and then try to talk to a C, C++, or Java programmer about the problem. I have always been partial to recursive languages, functional languages, and pattern-based languages (I even played around a little with REFAL on that last note). A combination of these attributes are more natural and readable to my sensibilities. Others may have their own conceptual and readability biases. As an aside: I hate statically typed languages, and so-called OO languages where the data have no type, but the containers you put them in have type and forces same on its data. I never understood the usefulness of a language that dictates if you take your laptop to the library it magically becomes a book and has no notion that it was ever anything else. What attracted me to erlang: I have been building a webserver / gameserver for the last 4 years on and off in my spare time (see www.5x5.net) out of general curiosity to understand all aspects of eCommerce from the technology underlying the gamesite, to the marketing, advertising, and business implications of an Internet only company, but also because I saw that the mega-media companies were taking over the Internet and service providers and I wanted to have my own capability that couldn't be usurped by the software vendor or service provider. At the time I thought Java was mature enough to support what I wanted to do, but it did have a couple limitations, including the fact that each simultaneous player had to have a separate thread (no support for non-blocking threads). I thought this would be challenging and teach me a little about threaded programming, but without the headaches of a C or C++ approach. After about 30K lines of Java in both applets and Tomcat servlets I was nearly ready to launch the website. I had built all the user account management, registration, demographics, automated email, MySQL web-based management tools (so I could manage the site from work or from home), and the gameserver (designed to deliver HTML pages, applets and ads all from the same IP address and port to tunnel through firewalls and deliver ads directly to the applet), and started an Alpha test. After 3-4 days the thread that reports when people enter and leave game rooms stopped responding. It didn't crash but it didn't do any more work. All other threads worked fine with ads, webpages and HTML still being delivered. Somehow it starved. After 4 weeks or so, Tomcat stopped running servlets intermittently. The logfiles had a message that the JVM could no longer spawn new threads (is that Java, Linux or Tomcat with the problem?). I had built some kickstart scripts and cronjobs that would attempt to restore freezes, etc. (oooh, this sounds too much like Microsoft and IBM's "self-healing" software), but it all seemed so hokey and unnecessary -- and still didn't solve the problem of giving me a remotely administerable non-stop server. Whenever the server came down all users in the gamerooms would freeze or get booted from their applets. There was no redundancy, distributed processing or fault tolerance. The latter was my mistake in the message protocol because it was possible to lose one message and not know the state of the game or be able to rejoin and reproduce without leaving the table and disrupting it for everyone else. I learned quite a bit, including Visual Age Java, but only enough to believe that while Java could solve the problem, it was the wrong language -- I felt I had hit its limits for this application. In desperation I abandoned the project and started browsing the web listlessly for several months. The main issues with Java boiled down to: 1) Threads are much easier than C, but still a royal pain 2) There are no useful tools for administering a server that I built 3) The OO straight-jacket is a major hindrance to web-based computing 4) There is no fault tolerance or distributed computing, the VM is heavy and flaky 5) The use of Java applets put a heavy constraint on the server in delivering content 6) Performance was always a concern, especially handling thousands of threads 7) Embedded capabilities were just being developed and not stable or performing well When I came across erlang it was obvious that #3 was solved straight away. The biggest pain was in message passing. Messages had to be received as a generic Msg type, a jump table based on the first byte was used to get a msg handler, which in turn parsed, converted and cast the message as the right object type (hopefully). Fighting the static type checking of the compiler every step of the way, I successfully created type-less objects and a functional callback implementation that resulted in a remote object (which of course had no knowledge or state corresponding to the originating object's environment space). All this immediately disappears and becomes natural with a functional approach, the first solution that you would attempt rather than the last futile try. Threading seemed to be completely a non-issue in erlang, with the added benefit that every user could be a separate process in addition to the game table itself, leading to an automatic distributed, fault-tolerant approach of losing only one game room rather than the entire server in a failure situation (and even the possibility that a game room fails but the game may continue on a new instance of a game room). I could freely add servers to allow more players without any more effort than the load-balancing aspect. The lighter VM solved #4, and the lightweight processes solved #6 beyond my wildest dreams (probably even beyond my ability to design a meaningful UI for 50,000 game tables per server). #5 was now not as great a concern because the load-balancing reduces the strain created by the Java applets. The trick is just faking them into believing everything is coming from the same server, or transparently relocating the user before delivering the applet. I have been reading the docs, fiddling around and have started reimplementing the server. I am getting 5-10 times code reduction with an incredible increase in code clarity. HTML and the pattern-based functional style are the perfect marriage. This brings back the happy days of LISP, but I find the code much more readable and the language concepts more succinct for this problem set than LISP was. The beauty of erlang is that it is small, clear and succinct and therefore implements problems clearly and efficiently. I've spent the last 4 months or so following the email list and reading docs. The learning curve for the full system is steeper than most every language I've pursued except the most interesting/useful ones: Smalltalk-80, Common LISP Object System with the Meta Object Protocol, and Java. Java may prove to be the largest and least useful of the set, its usefulness mainly is in improving on the C++ experiment. (Ada has to be the absolutely least useful steep learning curve language because it was designed by committee and not to solve any particular problem). The learning curve on the language itself is practically nil if you've ever used a functional language before, and if you haven't erlang promises the greatest hope that you ever will. OTP. The raging debate about this was the most informative thing I've read over the last few months, aside from those postings that corrected all my misperceptions of erlang the language. I decided to invest the time in erlang rather than skip over it like I did Mozart OZ, precisely because OTP was present. I have never seen anything like it, and it solved exactly the problem that I did not want to waste my time on -- developing another Java / Linux application set for managing the server. That task would have been bigger than the gameserver itself that had taken me way too long already. I believe OTP provides me: 1) Embedded turnkey system using SASL, reboot and all that 2) Non-stop server using supervision trees 3) Failover and takeover for seamless, continuous gameplay during server maintenance 4) Distributed debugging and logging that can be turned on and off at will 5) A complicated build, but with the result of hotcode version upgrade 6) Mnesia distributed database, with in memory and on disk capabilities 7) Pre-built behaviours that match my problem set Maybe I'm mistaken in evaluating based on the documents, and I'll find out that I'm not capable of making OTP work, but it has more promise than anything I've seen. OTP solves problems that I've not seen examples of having been solved before. I'm learning and the best way to learn is to take a real problem, push the limits and see where things break. In 6 months I should know. When I'm done with all this, I expect to be able to have gained knowledge enough that when someone asks me "Can A or B be done?" I can reply based on first-hand experience and have the confidence that if I say yes, I would be capable of delivering what was asked. In 5 years I may have to roll my own OTP; maybe I'll be deep in the source code 6 months from now figuring out how to roll my own. If I was still stuck with Java, I would be spending my time at the beach instead. Besides all that, erlang has got me excited about programming again. I'm trying to figure out how to sneak a prototype into my job to convert them as well. Right now, my day job is programming stock trading systems for mutual fund administrators using a homebrew rule-based dataflow language that no one seems to want any more (the language was developed there long before I arrived). Guess what, the problem requires non-stop, distributed, fault-tolerant, constraint-based, functional capabilites, with in memory DB, distributed logging, failover and realtime interactive monitoring, querying and progress reporting. Sounds like a job for erlang and OTP (Online Trading Platform). As a programmer, I really could care less what it is called, does it solve my problem in a way that I enjoy coding and maintaining? P.S. The Telephony of OTP did really put me off and delayed my looking into the capability until my problem made it apparent this was really useful. From a marketing standpoint a name is needed, as well as a separation between the language and the platform. More would download and play with the language. Only those with a real need will download the platform. Sorry for the loss of bandwidth. Had to drop in my 20,000 drachmas worth. jay --------------------------------------------------- DuoMark International, Inc. 6523 Colgate Avenue, Suite 325 Los Angeles, CA 90048-4410 / USA Voice: +1 323 381-0001 FAX: +1 323 549 0172 Email: jay@REDACTED WWW: http://www.duomark.com/ From peter@REDACTED Sun Feb 2 11:20:37 2003 From: peter@REDACTED (Peter Lund) Date: Sun, 2 Feb 2003 11:20:37 +0100 Subject: gif-1.0.tgz ?? Message-ID: I am trying to generate gifs in Erlang for my home hobby project on my W2K machine. On the home page, I found the package gif-1.0 published by Joe somtime 1995-98. This package is dependent of the c-module gd1.1.1 by Tom Boutell. Has there been any development in generating gifs since then? And are we (Erlang) still dependent on C to do this? Anyone? Peter Lund From ulf.wiger@REDACTED Sun Feb 2 17:24:43 2003 From: ulf.wiger@REDACTED (Wiger Ulf) Date: Sun, 2 Feb 2003 17:24:43 +0100 Subject: Why I chose erlang (very, very long story) References: <4.2.2.20030201140630.00cec200@duomark.com> Message-ID: <000701c2cad7$98955ca0$f67a40d5@telia.com> From: "Jay Nelson" > I thought I'd throw in my opinions as to why I am using erlang. I hope they > are useful to someone, especially the Ericsson Product Manager. <20,000 drachmas snipped> > Maybe I'm mistaken in evaluating based on the documents, and I'll > find out that I'm not capable of making OTP work, but it has more > promise than anything I've seen. <...> > Besides all that, erlang has got me excited about programming again. Thank you, Jay. Interesting read. I cannot promise you that OTP will live up to your expectations, but I'm pretty sure you will be able to make it work pretty well. Good luck trying to get your colleagues sold on Erlang as well. (: /Uffe From ulf.wiger@REDACTED Sun Feb 2 17:33:25 2003 From: ulf.wiger@REDACTED (Wiger Ulf) Date: Sun, 2 Feb 2003 17:33:25 +0100 Subject: gif-1.0.tgz ?? References: Message-ID: <000f01c2cad8$d3d9acc0$f67a40d5@telia.com> I did start on an erlang-based gif package, but didn't quite manage to get the LZW compression to work. This is not terribly easy using pre-bit syntax Erlang, and may not be that easy with bit syntax either... LZW uses variable word lengths, and I got lost in all the bit shifting across the 8-bit boundaries of binary_to_list(). I don't know if you could use the built-in lzw compression that erlang offers nowadays (I assume you could.) If so, I think I have a nearly working gif implementation (AFAIR, the rest was reasonably easy.) No promises though. I can send you what I have so far, but it may well be that there is nothing in there you can use. /Uffe ----- Original Message ----- From: "Peter Lund" To: "Erlang-Questions" Sent: den 2 februari 2003 11:20 Subject: gif-1.0.tgz ?? > I am trying to generate gifs in Erlang for my home hobby project > on my W2K machine. > > On the home page, I found the package gif-1.0 published by Joe > somtime 1995-98. This package is dependent of the c-module gd1.1.1 > by Tom Boutell. > > Has there been any development in generating gifs since then? > And are we (Erlang) still dependent on C to do this? Anyone? > > Peter Lund > > From luke@REDACTED Mon Feb 3 01:32:05 2003 From: luke@REDACTED (Luke Gorrie) Date: 03 Feb 2003 01:32:05 +0100 Subject: gif-1.0.tgz ?? In-Reply-To: <000f01c2cad8$d3d9acc0$f67a40d5@telia.com> References: <000f01c2cad8$d3d9acc0$f67a40d5@telia.com> Message-ID: "Wiger Ulf" writes: > I did start on an erlang-based gif package, but didn't quite manage to get > the LZW compression to work. This is not terribly easy using pre-bit syntax > Erlang, and may not be that easy with bit syntax either... LZW uses variable > word lengths, and I got lost in all the bit shifting across the 8-bit > boundaries of binary_to_list(). > > I don't know if you could use the built-in lzw compression that erlang > offers nowadays (I assume you could.) If so, I think I have a nearly working > gif implementation (AFAIR, the rest was reasonably easy.) No promises > though. > > I can send you what I have so far, but it may well be that there is nothing > in there you can use. I have a GIF _decoder_ in a similar state, i.e. there is some bug in the LZW decompressor that completely eludes me. Same offer applies. Actually, the bug may be in some other part, since I'm convinced that the LZW-coded data I give to my decompressor is not correct :-) but that's easy to be wrong about. For reading LZW codes I used a "bitstream" datatype that gets initialized with a binary and then lets you read N-bit integers one by one. The bit syntax helps quite a bit I think: %% BitStream = {TakenBits, binary()} %% %% TakenBits is the number of bits already taken from the first byte %% of the binary. new(Bin) -> {0, Bin}. take(N, {I0, Bin0}) -> I1 = (I0 + N) rem 8, SufBits = (8 - I1) rem 8, <<_:I0, Value:N, _:SufBits, _/binary>> = Bin0, TakenBytes = (I0 + N) div 8, % whole bytes taken <<_:TakenBytes/binary, Bin1/binary>> = Bin0, {Value, {I1, Bin1}}. Though after a year and a bit that doesn't seem quite so crystal clear.. :-) BTW, for using built-in LZW, it's worth a try but I think there are a lot of variations on LZW around. For instance, GIF and TIFF use very-slightly-different ones. The TIFF 6 spec also has the best LZW tutorial I've seen, and is googlable. I *think* the only difference is that TIFF increases the code size one value earlier than GIF, which seems silly (wastes a code.) Cheers, Luke From taj.khattra@REDACTED Mon Feb 3 04:43:38 2003 From: taj.khattra@REDACTED (Taj Khattra) Date: Sun, 2 Feb 2003 19:43:38 -0800 Subject: Other things I don't get (WAS: Re: A Joeish Erlang distribution (long)) In-Reply-To: Message-ID: <20030203034338.GA1355@localhost.localdomain> Ulf Wiger wrote: > The best proof yet that XML is indeed perfectly suitable for > every kind of application. (: check out 'the evolution of language': http://www.research.avayalabs.com/user/wadler/language.pdf we be doomed :) -taj From fritchie@REDACTED Mon Feb 3 07:58:08 2003 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Mon, 03 Feb 2003 00:58:08 -0600 Subject: gif-1.0.tgz ?? In-Reply-To: Message of "Sun, 02 Feb 2003 11:20:37 +0100." Message-ID: <200302030658.h136w8ar052356@snookles.snookles.com> >>>>> "pl" == Peter Lund writes: pl> I am trying to generate gifs in Erlang for my home hobby project pl> on my W2K machine. Must it be GIF? How about PNG, JPEG and WBMP images? I've got a driver for libgd (see http://www.boutell.com/gd/) that's 95% done.(*) See http://www.snookles.com/erlang/edtk/edtk-1.0-rc3.tar.gz for the source. The driver is extensively documented as an Erlang Driver Toolkit tutorial; I wrote it paragraph-for-paragraph while creating the driver. -Scott (*) There's an odd problem that I haven't solved with the regression test for the gd example driver: sometimes the linked-in style driver's output doesn't match byte-for-byte the pipe-style driver's output. However, if you convert both files to JPEG (with same compression/quality settings), they turn out identical. Version 1.0-rc3 also has an unfixed bug in the "sample1" driver that I also need to fix before a "real" 1.0 release. From peter@REDACTED Mon Feb 3 10:12:34 2003 From: peter@REDACTED (Peter Lund) Date: Mon, 3 Feb 2003 10:12:34 +0100 Subject: SV: gif-1.0.tgz ?? In-Reply-To: <200302030658.h136w8ar052356@snookles.snookles.com> Message-ID: Gif seemed good since I was planning to present generated, few colour, pictures, via an erlang inets server. Both IE6 and NS7 support png pictures as well, so png would do as well as gif, for my purposes. I see on http://www.boutell.com/gd/ that gd does NOT support gifs anymore since LZW compression is patented by Unisys. To run gif-1.0.tgz, I had to find and download GCC and Make support and then get this to work in my environment. Nicer (for Erlang/OTP) would have been if graphics for the web could be generated just using Erlang/OTP. Good would also have been if it would be possible to import a picture (gif,png,...), make modifications on it and then publish it. Now you have to start drawing the picture from scratch. Thanks, Peter > -----Ursprungligt meddelande----- > Fr?n: Scott Lystig Fritchie [mailto:fritchie@REDACTED] > Skickat: den 3 februari 2003 07:58 > Till: Peter Lund > Kopia: Erlang-Questions > ?mne: Re: gif-1.0.tgz ?? > > > >>>>> "pl" == Peter Lund writes: > > pl> I am trying to generate gifs in Erlang for my home hobby project > pl> on my W2K machine. > > Must it be GIF? How about PNG, JPEG and WBMP images? I've got a > driver for libgd (see http://www.boutell.com/gd/) that's 95% done.(*) > > See http://www.snookles.com/erlang/edtk/edtk-1.0-rc3.tar.gz for the > source. The driver is extensively documented as an Erlang Driver > Toolkit tutorial; I wrote it paragraph-for-paragraph while creating > the driver. > > -Scott > > (*) There's an odd problem that I haven't solved with the regression > test for the gd example driver: sometimes the linked-in style driver's > output doesn't match byte-for-byte the pipe-style driver's output. > However, if you convert both files to JPEG (with same > compression/quality settings), they turn out identical. > > Version 1.0-rc3 also has an unfixed bug in the "sample1" driver that I > also need to fix before a "real" 1.0 release. > From DANIESC.SCHUTTE@REDACTED Mon Feb 3 10:55:30 2003 From: DANIESC.SCHUTTE@REDACTED (DANIESC SCHUTTE) Date: Mon, 03 Feb 2003 11:55:30 +0200 Subject: non-telecom in erlang Message-ID: Hello all, What kind of information would be required. I've got permission from the CEO of Teba Bank (South Africa) to disclose "relevant" information. We would like to let the Erlang community know about this - (we've been approached for an adaptation for a gsm cellular billing system integration - and would like to have input / advice on this as well in order to futher the solutions possibilities.) Regards Danie Schutte Danie Schutte Phone: +27 - 11 - 203 - 1613 Mobile: 084-468-3138 e-Mail: Daniesc@REDACTED >>> Miguel Barreiro Paz 01/31/03 02:14PM >>> Daniel, > We just completed a full banking system using erlang - so Open > Transaction / Transacting Platform is also applicable. (BTW - the > system is a full billing system as well - all nicely integrated in an > OTP fashion. Could you provide more info on your system? It looks like a very interesting "look, erlang works for this" showcase. There is people around here working on a Risk Management System in erlang. Regards, Miguel ##################################################################################### The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy and copies. ##################################################################################### From Jozsef.Berces@REDACTED Mon Feb 3 11:01:11 2003 From: Jozsef.Berces@REDACTED (Jozsef Berces (QCZ)) Date: Mon, 3 Feb 2003 11:01:11 +0100 Subject: gif-1.0.tgz ?? Message-ID: <9CC6CC2973F2D211B3580008C70DB2D2057089A5@eatvint903.dsa.ericsson.se> I have already implemented a small and simple code to generate PNG images. At the moment it supports B&W pictures only, but adding colors would not be too hard. Another limitation is that it does not use compression, so it is not that good for large images. I am posting it "as is". BR, Jozsef -----Original Message----- From: Peter Lund [mailto:peter@REDACTED] Sent: Sunday, February 02, 2003 11:21 To: Erlang-Questions Subject: gif-1.0.tgz ?? I am trying to generate gifs in Erlang for my home hobby project on my W2K machine. On the home page, I found the package gif-1.0 published by Joe somtime 1995-98. This package is dependent of the c-module gd1.1.1 by Tom Boutell. Has there been any development in generating gifs since then? And are we (Erlang) still dependent on C to do this? Anyone? Peter Lund -------------- next part -------------- A non-text attachment was scrubbed... Name: png.erl Type: application/octet-stream Size: 7802 bytes Desc: not available URL: From Sean.Hinde@REDACTED Mon Feb 3 13:24:50 2003 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 3 Feb 2003 12:24:50 -0000 Subject: gif-1.0.tgz ?? Message-ID: I have been playing with the gif-1.0 contrib and it works quite nicely. There ain't a lot of error checking in the C code but it works well enough and is easy to modify. I've also nearly got Scott's edtk version running. Just some final couple of gremlins getting all the supporting libs to compile cleanly.. Anyway, here's to June when the dreaded LZW patent runs out - I'd guess the libgd author will celebrate with a big bang launch of gif support - it is not as though he doesn't have the code, as he is the same guy who wrote the one in Joe's contrib :) If anyone wishes to send me their nearly complete Erlang version though I'm happy to spend a little time digging around to see if I can add anything to the party. Sean > -----Original Message----- > From: Peter Lund [mailto:peter@REDACTED] > Sent: 03 February 2003 09:13 > To: Scott Lystig Fritchie > Cc: Erlang-Questions > Subject: SV: gif-1.0.tgz ?? > > > Gif seemed good since I was planning to present generated, few colour, > pictures, via an erlang inets server. Both IE6 and NS7 support png > pictures as well, so png would do as well as gif, for my purposes. > > I see on http://www.boutell.com/gd/ that gd does NOT support gifs > anymore since LZW compression is patented by Unisys. > > To run gif-1.0.tgz, I had to find and download GCC and Make support > and then get this to work in my environment. Nicer (for Erlang/OTP) > would have been if graphics for the web could be generated just using > Erlang/OTP. Good would also have been if it would be possible to > import a picture (gif,png,...), make modifications on it and then > publish it. Now you have to start drawing the picture from scratch. > > Thanks, > Peter > > > -----Ursprungligt meddelande----- > > Fr?n: Scott Lystig Fritchie [mailto:fritchie@REDACTED] > > Skickat: den 3 februari 2003 07:58 > > Till: Peter Lund > > Kopia: Erlang-Questions > > ?mne: Re: gif-1.0.tgz ?? > > > > > > >>>>> "pl" == Peter Lund writes: > > > > pl> I am trying to generate gifs in Erlang for my home hobby project > > pl> on my W2K machine. > > > > Must it be GIF? How about PNG, JPEG and WBMP images? I've got a > > driver for libgd (see http://www.boutell.com/gd/) that's > 95% done.(*) > > > > See http://www.snookles.com/erlang/edtk/edtk-1.0-rc3.tar.gz for the > > source. The driver is extensively documented as an Erlang Driver > > Toolkit tutorial; I wrote it paragraph-for-paragraph while creating > > the driver. > > > > -Scott > > > > (*) There's an odd problem that I haven't solved with the regression > > test for the gd example driver: sometimes the linked-in > style driver's > > output doesn't match byte-for-byte the pipe-style driver's output. > > However, if you convert both files to JPEG (with same > > compression/quality settings), they turn out identical. > > > > Version 1.0-rc3 also has an unfixed bug in the "sample1" > driver that I > > also need to fix before a "real" 1.0 release. > > > > 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 Marc.Vanwoerkom@REDACTED Mon Feb 3 13:42:28 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Mon, 3 Feb 2003 13:42:28 +0100 (MET) Subject: gif-1.0.tgz ?? In-Reply-To: (message from Luke Gorrie on 03 Feb 2003 01:32:05 +0100) Message-ID: <200302031242.h13CgS910391@bonsai.fernuni-hagen.de> > I have a GIF _decoder_ in a similar state, i.e. there is some bug in > the LZW decompressor that completely eludes me. Same offer applies. Wouldn't it be wiser to move to PNG or some other format, because the patent issues involved? Regards, Marc From mickael.remond@REDACTED Mon Feb 3 14:51:21 2003 From: mickael.remond@REDACTED (Mickael Remond) Date: Mon, 3 Feb 2003 14:51:21 +0100 Subject: Erlang projects association Message-ID: <20030203135121.GA21096@mremond.cgey.capgemini.fr> Hello, Two years ago, we made the Erlang-fr.org website. Its mission was to promote Erlang in France. We now realize that two things were wrong: - We should not have limited this initiative to France. - We did not pay enough attention to the fact that promoting Erlang is currently a very difficult task without a proper understanding of the real expectations of both the users and the developers. For the latter, the recent activity on this mailing list seems to indicate that we are not alone ;-) That's why we have decided to create an association to pragmatically work on those issues. The main goal of this association is to gather users and developers, both individuals and companies to work on projects that are needed to help us spread Erlang. The first tasks will be to identify the major domains for which Erlang should shine. We will then start dedicated workgroups that will have to identify existing relevant projects and to help them go further. We are aware that this quick announcement seems quite abstract at the moment but hopefully it will soon get "real" :-) Stay tuned ! ;-) -- Thierry Mallard Micka?l R?mond http://www.erlang-fr.org/ From LHL@REDACTED Mon Feb 3 15:28:45 2003 From: LHL@REDACTED (Lars H. Larsen, ICCC) Date: Mon, 03 Feb 2003 15:28:45 +0100 Subject: Windows 2000 'hanging' IP ports Message-ID: Hello to all Guru's and wizards does anybody have expirence here ??? I have a client/server application that did run fine with the socket library in earlier OTP releases , but after an upgrade to OTP R9 -0 I have to use gen_tcp and it gives me problems in Win2k and XP I made a small test application to isolate the problem. you'll find it below -when the client dies , there is no problems when reconnecting and data xfer later but if the server dies they seem to reconnet but The data xfer is fucked up it's just "TIMEOUT" on both ends. the program automatically descide wether it should be server or client. what is happening ?? Regards Lars Larsen __________________________________________ cut her -module(test). -export([start/2]). -record(socket,{ip, datsoc, listsoc,type}). start(Name,Iterations) when integer(Iterations) -> start(Name,5999,Iterations). start(Name,Port,Iterations) -> case gen_tcp:connect(Name,Port, [{packet,2},{active,true},{reuseaddr, true}]) of {error,_Reason} -> io:format("connect error ~p~n",[_Reason]), runserver(Name,Iterations,Port); {ok,Socket} -> io:format("Client~n"), gen_tcp:send(Socket,"go ahead server"), clientping(Iterations,#socket{type=client ,datsoc = Socket, ip = Name}) end. clicon(Iterations,Rec)-> gen_tcp:close(Rec#socket.datsoc), %io:format("~p~n",[erlang:ports()]), case gen_tcp:connect(Rec#socket.ip,5999, [{packet,2},{active,true},{reuseaddr, true}]) of {ok,Socket} -> clientping(Iterations,Rec#socket{type=client ,datsoc = Socket}); {error,_X} -> clicon(Iterations,Rec); _P -> io:format("clicon ~p~n",[_P]) end. runserver(Name,Iterations,Port) -> io:format("Server~n"), case gen_tcp:listen(Port,[{packet, 2}, {active,true},{reuseaddr, true}]) of {error,_Any} -> io:format("Listen result ~p~n",[_Any]); {ok,ListenSocket} -> io:format("Listen ok~n"), {ok,Socket}= gen_tcp:accept(ListenSocket), io:format("Accepted ok ~p ~n",[Iterations]), serverping(Iterations,#socket{type=server,datsoc = Socket,listsoc=ListenSocket,ip=Name}) end. clientping(0,Rec) -> gen_tcp:close(Rec#socket.datsoc), io:format("the end ~n"); clientping(Iterations,Rec) -> %io:format("Loop ~p Rec ~p ~n",[Iterations,Rec]), receive {tcp,Datsoc,Data} -> io:format("~w :GOT Data:~p ~n",[Rec#socket.type,Data]), gen_tcp:send(Datsoc,"Are you well"), clientping(Iterations-1,Rec); {tcp_closed,Consocket} -> io:format("{tcp_closed,Consocket}~n"), clicon(Iterations,Rec); Thing -> io:format(" ~p :GOT: ~p",[Rec#socket.type,Thing]), clientping(Iterations-1,Rec) after 1000-> io:format("TIMEOUT ~p ~n",[Rec]), clientping(Iterations-1,Rec) end. serverping(0,Rec) -> gen_tcp:close(Rec#socket.datsoc), gen_tcp:close(Rec#socket.listsoc), io:format("the end ~n"); serverping(Iterations,Rec) -> %io:format("Loop ~p Rec ~p~n",[Iterations,Rec]), receive {tcp,Datsoc,Data} -> io:format("~w :GOT Data:~p ~n",[Rec#socket.type,Data]), gen_tcp:send(Rec#socket.datsoc,"fine Thank you "), serverping(Iterations-1,Rec); {tcp_closed,Soc} -> gen_tcp:close(Rec#socket.listsoc), gen_tcp:close(Rec#socket.datsoc), runserver(Rec#socket.ip,Iterations,5999); Thing -> io:format(" ~p :GOT: ~p",[Rec#socket.type,Thing]), serverping(Iterations-1,Rec) after 1000-> io:format("TIMEOUT ~p ~n",[Rec]), serverping(Iterations-1,Rec) end. From Vlad.Dumitrescu@REDACTED Mon Feb 3 16:38:57 2003 From: Vlad.Dumitrescu@REDACTED (Vlad Dumitrescu (EAW)) Date: Mon, 3 Feb 2003 16:38:57 +0100 Subject: Windows 2000 'hanging' IP ports Message-ID: <5F03ACA2F76DD411B8BC00508BE3B4D71200F735@esemont203.gbg.edt.ericsson.se> Hi, I think the server and the client are deadlocked. The client loops inside clientping, and the server inside serverping, waiting for the other to talk. At startup, you use gen_tcp:send(Socket,"go ahead server"), to get things started, but this isn't the case after the server restarts. I think that just letting the server say something will break the lock. regards, Vlad From daniel.dudley@REDACTED Mon Feb 3 17:46:19 2003 From: daniel.dudley@REDACTED (Daniel Dudley) Date: Mon, 3 Feb 2003 17:46:19 +0100 Subject: Erlang projects association References: <20030203135121.GA21096@mremond.cgey.capgemini.fr> Message-ID: <030e01c2cba3$c6d99050$85d1b33e@dld2000> Are we to understand that this will now be an international association? Daniel ----- Original Message ----- From: "Mickael Remond" To: Sent: Monday, February 03, 2003 2:51 PM Subject: Erlang projects association > Hello, > > Two years ago, we made the Erlang-fr.org website. Its mission was to > promote Erlang in France. We now realize that two things were wrong: > - We should not have limited this initiative to France. > - We did not pay enough attention to the fact that promoting Erlang is > currently a very difficult task without a proper understanding of the > real expectations of both the users and the developers. > For the latter, the recent activity on this mailing list seems to > indicate that we are not alone ;-) > > That's why we have decided to create an association to pragmatically > work on those issues. The main goal of this association is to gather > users and developers, both individuals and companies to work on projects > that are needed to help us spread Erlang. > > The first tasks will be to identify the major domains for which Erlang > should shine. We will then start dedicated workgroups that will have to > identify existing relevant projects and to help them go further. > > We are aware that this quick announcement seems quite abstract at the > moment but hopefully it will soon get "real" :-) > > Stay tuned ! ;-) > > -- > Thierry Mallard > Micka?l R?mond > http://www.erlang-fr.org/ From daniel.dudley@REDACTED Mon Feb 3 18:05:47 2003 From: daniel.dudley@REDACTED (Daniel Dudley) Date: Mon, 3 Feb 2003 18:05:47 +0100 Subject: Other things I don't get (WAS: Re: A Joeish Erlang distribution (long)) References: <20030203034338.GA1355@localhost.localdomain> Message-ID: <004f01c2cba6$7f2e5df0$85d1b33e@dld2000> Taj Khattra wrote: > check out 'the evolution of language': > > http://www.research.avayalabs.com/user/wadler/language.pdf Yep, that's seems to be a correct interpretation of the current "state of the art." ;-) > we be doomed :) Indeed we would -- if we didn't have an alternative to go to. ;-) Daniel From luke@REDACTED Mon Feb 3 18:04:51 2003 From: luke@REDACTED (Luke Gorrie) Date: 03 Feb 2003 18:04:51 +0100 Subject: Erlang projects association In-Reply-To: <20030203135121.GA21096@mremond.cgey.capgemini.fr> References: <20030203135121.GA21096@mremond.cgey.capgemini.fr> Message-ID: Mickael Remond writes: > That's why we have decided to create an association to pragmatically > work on those issues. The main goal of this association is to gather > users and developers, both individuals and companies to work on projects > that are needed to help us spread Erlang. > > The first tasks will be to identify the major domains for which Erlang > should shine. We will then start dedicated workgroups that will have to > identify existing relevant projects and to help them go further. For this to work I think you will have to do something radical. I say this after seeing a zillion similar projects with the best of intentions never generate any code -- I'm not aware of even one that's actually worked. I can give you any number of references if you like, where you can relive their fizzling-out through mailing list archives :-). So not to say it's a bad idea, but it will have to be done somehow different to all the others to have a chance IMHO. On a personal note, by far the most important thing I've learned over the past few years is to try not to talk about programs until I've written them. Since I want to talk about them, I end up doing lots more fun little hacks, instead of just talking about the ideas and moving on. If I ever learn not to talk about programs until I've written manuals for them, I might just become a professional programmer. :-) Cheers, Luke-the-party-pooper :-) From Sean.Hinde@REDACTED Mon Feb 3 19:01:45 2003 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 3 Feb 2003 18:01:45 -0000 Subject: Other things I don't get (WAS: Re: A Joeish Erlang distributi on (long)) Message-ID: > Taj Khattra wrote: > > check out 'the evolution of language': > > > > http://www.research.avayalabs.com/user/wadler/language.pdf > > Yep, that's seems to be a correct interpretation of the > current "state of the art." ;-) > > > we be doomed :) > > Indeed we would -- if we didn't have an alternative to go > to. ;-) Go Go UBF! Has anyone beefed up the Java support for this? I'd like to give our IT/Java/Weblogic wallahs some production standard client code which they can just deploy (and save us CORBA/LDAP issues) 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 mickael.remond@REDACTED Mon Feb 3 21:33:47 2003 From: mickael.remond@REDACTED (Mickael Remond) Date: Mon, 3 Feb 2003 21:33:47 +0100 Subject: Erlang projects association In-Reply-To: <030e01c2cba3$c6d99050$85d1b33e@dld2000> References: <20030203135121.GA21096@mremond.cgey.capgemini.fr> <030e01c2cba3$c6d99050$85d1b33e@dld2000> Message-ID: <20030203203346.GA3486@erlang.dyndns.org> * Daniel Dudley [2003-02-03 17:46:19 +0100]: > Are we to understand that this will now be an international > association? International sound a bit megalomaniac, but taken in a pragmatic way, yes this is the idea, as France is not where the things are happening, because things are happening everywhere. Interesting projects are popping up everywhere and it would be good to know them and promote them ... For exemple, an online game development in Erlang might interest maybe 10 to 20 people in the world, but only two people in France. It will not happen if the development community is too small and I think that positioning the promotion at the country level is limiting with no valid reason. I think focusing to French speaking people was probably mainly a matter of lazyness for my part, as it is easier for me to write in French than in English ;-) And, as Linux Torvald once said when asked about what he wanted for Linux future: "World domination, fast !" I think this is what we all see for Erlang ;-) (Just kidding, in case this is not obvious) -- Micka?l R?mond From erlang@REDACTED Tue Feb 4 17:50:46 2003 From: erlang@REDACTED (Inswitch Solutions - Erlang Evaluation) Date: Tue, 4 Feb 2003 17:50:46 +0100 Subject: Jinterface and Java Applets Message-ID: <007a01c2cc6d$9fc36700$1e00a8c0@design> - Can I use JInterface package in a Java Applet (not signed applet) ? If so, does someone have an example of how to use Jinterface. - Is it better to use TCP for Erlang-Java Applets communication ? Thanks, Eduardo Figoli INSwitch Solutions. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mickael.remond@REDACTED Mon Feb 3 21:50:12 2003 From: mickael.remond@REDACTED (Mickael Remond) Date: Mon, 3 Feb 2003 21:50:12 +0100 Subject: Erlang projects association In-Reply-To: References: <20030203135121.GA21096@mremond.cgey.capgemini.fr> Message-ID: <20030203205012.GB3486@erlang.dyndns.org> * Luke Gorrie [2003-02-03 18:04:51 +0100]: > Mickael Remond writes: > > > That's why we have decided to create an association to pragmatically > > work on those issues. The main goal of this association is to gather > > users and developers, both individuals and companies to work on projects > > that are needed to help us spread Erlang. > > > > The first tasks will be to identify the major domains for which Erlang > > should shine. We will then start dedicated workgroups that will have to > > identify existing relevant projects and to help them go further. > > For this to work I think you will have to do something radical. I say > this after seeing a zillion similar projects with the best of > intentions never generate any code -- I'm not aware of even one that's > actually worked. I can give you any number of references if you like, > where you can relive their fizzling-out through mailing list archives > :-). So not to say it's a bad idea, but it will have to be done > somehow different to all the others to have a chance IMHO. Yes, you are right. This is project has a lot of chance to die very quickly ... if we are the only one enthousiastic about the idea ;-) I do not pretend that I have some particularly good idea of vision for Erlang ... but I think one should and could emerge collectively. > On a personal note, by far the most important thing I've learned over > the past few years is to try not to talk about programs until I've > written them. Since I want to talk about them, I end up doing lots > more fun little hacks, instead of just talking about the ideas and > moving on. Hum. We were not necessarily speaking about coding. I have partipated in many open source projects and I know that a vast majority of them die very soon (mainly because it was a way of learning new things for the developers and when his "formation" is over, the developer need to go to something else) One the one that are successfull, they do not rely on a big community neither, very often, one to three developers are pushing the software further. But what also matter in sucessfull is promotion, knowledge, comments, etc. Even motivated developers needs feedback at some points. That is why the object of the association is to help existing projects. By help I mean that this could be code, but also feedback, promotion by promoting the work that is being done, encouragements, documentations of the software, tests, feature request, etc. If the association is very lucky and very successful, it might even start new project but this is more a matter of sharing infrastructure with some members that have a good ideas. For example, having the opportunity to experiment with an Erlang server on the web could be interesting for some developers. However ISP does not (yet) offer Erlang hosting. We could share a machine for those experiments. Do not forget that the competition between languages is also a matter of visibility. Really a lot of things are already happenning is the Erlang world. I feel that the language is spreading well these days, but this might not be obvious for the people that are not already "gained" to the Erlang "virus". > If I ever learn not to talk about programs until I've written manuals > for them, I might just become a professional programmer. :-) And, do not forget that association are also a way to have regularly have a drink with friendly people (I am quite sure you will like this last argument ;-) > Cheers, \ / As I said, cheers v ;-) | - -- Mickae?l R?mond From thierry.mallard@REDACTED Mon Feb 3 22:40:51 2003 From: thierry.mallard@REDACTED (Thierry Mallard) Date: Mon, 3 Feb 2003 22:40:51 +0100 Subject: Erlang projects association In-Reply-To: <20030203203346.GA3486@erlang.dyndns.org> References: <20030203135121.GA21096@mremond.cgey.capgemini.fr> <030e01c2cba3$c6d99050$85d1b33e@dld2000> <20030203203346.GA3486@erlang.dyndns.org> Message-ID: <20030203214051.GA1860@hobbes.local.vawis.net> On Mon, Feb 03, 2003 at 09:33:47PM +0100, Mickael Remond wrote: > * Daniel Dudley [2003-02-03 17:46:19 +0100]: > > > Are we to understand that this will now be an international > > association? > > International sound a bit megalomaniac, but taken in a pragmatic way, > yes this is the idea, as France is not where the things are happening, > because things are happening everywhere. > [...] On a side note (and somewhat administrative one), our current idea is to start with a non-lucrative association which will be based in France, simply because we know how to do that ;-) With a growing number of members, all over the world, we may together choose to move this association somewhere else. With best regards, -- Thierry Mallard http://vawis.net From mickael.remond@REDACTED Mon Feb 3 22:53:20 2003 From: mickael.remond@REDACTED (Mickael Remond) Date: Mon, 3 Feb 2003 22:53:20 +0100 Subject: non-telecom in erlang In-Reply-To: References: Message-ID: <20030203215319.GD3486@erlang.dyndns.org> * DANIESC SCHUTTE [2003-02-03 11:55:30 +0200]: > Hello all, > > What kind of information would be required. I've got permission from > the CEO of Teba Bank (South Africa) to disclose "relevant" > information. We would like to let the Erlang community know about > this - (we've been approached for an adaptation for a gsm cellular > billing system integration - and would like to have input / advice on > this as well in order to futher the solutions possibilities.) One question is: Why did you choose Erlang for this development ? What was the most important elements that lead you to choose Erlang. What are the needed interface to the external world ? Did you need to create some link with special software running on dedicated hardware ? Do you use distribution ? What is the user interface for the system ? Do you have piece of the software that you choose not to write in Erlang ? Thank you in advance for your feedback :-) -- Micka?l R?mond From valentin@REDACTED Tue Feb 4 08:26:25 2003 From: valentin@REDACTED (Valentin) Date: Tue, 4 Feb 2003 09:26:25 +0200 Subject: Erlang projects association References: <20030203135121.GA21096@mremond.cgey.capgemini.fr> Message-ID: <00a001c2cc1e$ba48bed0$87ea1ec4@moneymaker> > - We should not have limited this initiative to France. Does this mean that your association did not attract the critical mass in France? If so, why, in your opinion, it didn't? > - We did not pay enough attention to the fact that promoting Erlang is > currently a very difficult task without a proper understanding of the > real expectations of both the users and the developers. Maybe you should lead by an example, and tell us what are yours (personal) expectations from such an organization/association. > For the latter, the recent activity on this mailing list seems to > indicate that we are not alone ;-) Yup. Everybody is trying to make living. >That's why we have decided to create an association to pragmatically > work on those issues. How does one work "pragmatically on those issues". Can you be a bit more specific? > The main goal of this association is to gather > users and developers, both individuals and companies to work on projects > that are needed to help us spread Erlang. To what end? Maybe you should try to convince me (and maybe others) how is my life going to be better if I "join the association". What would I gain from spreading Erlang -- I understand only my reasons for doing it. I cannot say that I understand yours... you must articulate it better. In my view, an association can be successful only if the individual members can align with the goals. We might as well help spread peanut butter on (or to) China. And what would be the benefit of doing it? > The first tasks will be to identify the major domains for which Erlang > should shine. We will then start dedicated workgroups that will have to > identify existing relevant projects and to help them go further. I suppose you have funding for that? Valentin. From D.WILLIAMS@REDACTED Tue Feb 4 08:58:33 2003 From: D.WILLIAMS@REDACTED (WILLIAMS Dominic) Date: Tue, 4 Feb 2003 08:58:33 +0100 Subject: non-telecom in erlang Message-ID: > From: DANIESC SCHUTTE [mailto:DANIESC.SCHUTTE@REDACTED] > > What kind of information would be required. I've got > permission from the CEO of Teba Bank (South Africa) to > disclose "relevant" information. We would like to let the > Erlang community know about this - (we've been approached for > an adaptation for a gsm cellular billing system integration - > and would like to have input / advice on this as well in > order to futher the solutions possibilities.) As I am currently considering adopting Erlang for a project, I would be interested to know: - what were you using before? - why did you choose Erlang? - how long did the team take to learn Erlang and become productive? - how many members of the team had previous Erlang experience? - a brief description of the system's architecture, and the parts of Erlang that were used or not used. - what improvements did you observe compared to previous, non-Erlang, projects? - are you glad you chose Erlang, will you continue with Erlang, and would you recommend Erlang to others? Thanks, Dominic. From DANIESC.SCHUTTE@REDACTED Tue Feb 4 09:29:17 2003 From: DANIESC.SCHUTTE@REDACTED (DANIESC SCHUTTE) Date: Tue, 04 Feb 2003 10:29:17 +0200 Subject: non-telecom in erlang Message-ID: Greetings all, Mickael Initial answers: (if it is too short - or you want more information - please let me know) Firstly: Teba Bank services the lower end of the South African market, the system is designed for maximum speed (our target market is 85% of the South African market) and THE LOWEST POSSIBLE transaction cost. The bank has been in existence for 24 years and has been paying the mine worker salaries of a lot of mines in South Africa and have only become a formal bank 2 years ago. The FDFC - situated in the UK, must also be mentioned (Financial Deepening Challenge Fund) as they provided a grant to this project. Ok the nitty gritty technical stuff: The system requirement is a 100% uptime, 24x365. The biggest benefit is real time ABC (activity based costing). Meaning - if a ussd message was sent with a transaction for processing and the transaction concludes about 0.4 seconds later ( :) ) all costs have been allocated to all the relevant cost centres/ accounts. Meaning - the funds to pay for the USSD has been paid to the GSM operator, the tax has been provisioned for, the transaction fees are taken and allocated to the relevant cost centres. Meaning - if I want a balance (via USSD from my phone - on what I need to pay over to the GSM operator - I get an up to the second amount). 1. Choosing Erlang - (the why?) not necessarily in order. a) All the standard spiel you get about it. (Robust, realtime-code updates, and all the weird and wonderfull stuff you get in the manuals :) ). b) Multi-platform (We run Solaris i386 / Sparc - Windows was considered but rejected at some point - and linux might be a future option) c) OTP. What is the difference in ESSENCE between switching a telephone call, and switching money. (Erlang in our mind was essentially a SWITCHING language - but has grown to a lot more). d) The learning curve was not as steep as anticipated. e) Code size is a lot smaller and development a lot faster. f) BRILLIANT SUPPORT - with the guys responding to some of our queries in less than 15 minutes on an opensource project - that is why the budget this year includes licensing fees :). g) Interoperability with other languages ( C ). h) The choice felt right. i) Was there ever another choice :) - on the table was C, Kylix, Delphi, Java and Erlang. 2. Interfaces to the external world We have a module called ConnectionManager that handles all external and internal connections to the processing "engine". Writing a new interface - currently about 2 - 4 days before testing. (ISO8583 flavours - 1 day :) ). XML is a change request :) Physical: USSD over TCP/IP, TCP/IP and X-COM (we gotta talk to a mainframe somewhere :) ) a) Point of Sale Banking (USSD Phase I communications) Erlang with a C api handling the requests. (This is because we service the South African rural market - and there is NO FORMAL COMMUNICATIONS mechanisms - except GSM. b) Bankserve (central banking switch for SA) - an ISO8583 Postbridge interface (Postilion) over a tcp/ip link. Both as an issuer as well as an acquirer. c) SA Debit Card Switch (same as above) d) Mastercard ISO8583 interface specification (Issuer and acquirer) e) ACB (Batch based transactions). f) Front-ends handled by the current banking system - and information passed via tcp/ip to us. g) Customer Relationship Management interface - via tcp/ip h) External General Ledger interface - via tcp/ip i) External Hardware Security Module communications. (We used crypto initially - but the requirements are for a hardware security module) CRYPTO works fine (if you add some stuff :) ) Hardware: We are running triple failover (3 separate sites - simultaneously processing all transactions) with an additional backup / disaster recovery site. Each site: 1 x SUN SPARC Database Server (currently running Sybase 12.5) (we are looking at MNesia for some of our next roll-outs) 2 x Compaq DL360 Application Servers (Doing the physical transaction processing). Solaris 8 O/S No special hardware, no special software. 3. Distribution Yes, we have implemented distribution both for processing power as well as fail over - see above. We are looking at moving into the load balancing area now. 4. User Interface Front ends are the only windows machines so far. Since it is a banking system - we have isolated the user interfaces into delphi front ends - that communicate via tcp/ip messages to erlang modules that verify the security and then process the relevant transactions. We are looking at converting this to Java or even Erlang - but for now that was a bit much :). 5. Non Erlang Code Languages: Delphi 6, C. The user interface, and the API calls to the Sybase database, and the API calls the the Sema USSD server is THE ONLY code not written in erlang. We have module called DBI (database interface) that handles the writing to the database through the api and verifies that all went well and connect_ussd which handles the sema api calls. The user interface also converses with the erlang modules. Any suggestions or queries are more than welcome. Marketing spiel: If you need a billing / banking / POS / transacting system - talk to us - as the idea is to distribute this type of system (after successful conclusion of our pilot) - and we work in rands :) which is worth almost NOTHING :) hehehehe Regards Danie Schutte Danie Schutte Phone: +27 - 11 - 203 - 1613 Mobile: 084-468-3138 e-Mail: Daniesc@REDACTED >>> Mickael Remond 02/03/03 11:53PM >>> * DANIESC SCHUTTE [2003-02-03 11:55:30 +0200]: > Hello all, > > What kind of information would be required. I've got permission from > the CEO of Teba Bank (South Africa) to disclose "relevant" > information. We would like to let the Erlang community know about > this - (we've been approached for an adaptation for a gsm cellular > billing system integration - and would like to have input / advice on > this as well in order to futher the solutions possibilities.) One question is: Why did you choose Erlang for this development ? What was the most important elements that lead you to choose Erlang. What are the needed interface to the external world ? Did you need to create some link with special software running on dedicated hardware ? Do you use distribution ? What is the user interface for the system ? Do you have piece of the software that you choose not to write in Erlang ? Thank you in advance for your feedback :-) -- Micka?l R?mond ##################################################################################### The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy and copies. ##################################################################################### From joe@REDACTED Tue Feb 4 10:09:19 2003 From: joe@REDACTED (Joe Armstrong) Date: Tue, 4 Feb 2003 10:09:19 +0100 (CET) Subject: Publicity Message-ID: Just a quick thought. I have for a long time thought that this mailing list should have a more public face - are there any opinion for or against a move to a usenet group or something else, for example a yahoo group etc. Alternatively - we could keep things as they are and add gateway functions into other forums - we could also do stuff to increase chances that google indexes posting to this mailing list. Comments, ideas ?? /Joe From DANIESC.SCHUTTE@REDACTED Tue Feb 4 10:34:48 2003 From: DANIESC.SCHUTTE@REDACTED (DANIESC SCHUTTE) Date: Tue, 04 Feb 2003 11:34:48 +0200 Subject: non-telecom in erlang Message-ID: Morning Dominic, some of your questions have been answered in my previous mail - I will however answer some of the rest of the questions here - thanks for all the interest (everyone). Using before: Delphi / Java / C / Magic 386 / Visual Basic. This is not only our team but other projects in the banks as well - that is why some of these were on the consideration list. Once the decision to standardize on Solaris - it became easier :). We wanted a robust - online - realtime system. - how long did the team take to learn Erlang and become productive? Read the books for 2 - 3 weeks and dabbled. First production module in week 3, from there on - we train a new programmer in 4 weeks, and then another 4 weeks and the guy does 1st and 2nd level support and after 3 months - he's a pro :). Seriously - once you get to grips with how it works - and have other people that can show and guide you - it really is not that difficult. Me and Heinrich Venter - currently sit at 10 months with Erlang - and although we are getting a consultant (when the budget comes through end of the month) to come and review and help and better our understanding - the system is running fairly smoothly. Mostly due to the excellent support from the people on the mailing list. - how many members of the team had previous Erlang experience? None :) The nearest we got was 3 weeks university knowledge of prolog :). - a brief description of the system's architecture, and the parts of Erlang that were used or not used. Hmmm the hardware was discussed in the previous message. The system consists of about 40 applications. All communcations done to a central connection manager - which uses translations and routing to divert the transaction messages to the relevant sections of the system and it all ends up at a transaction manager - that does all the transaction stuff required by a bank, costing, validation, general ledger entries. The previous mail gives an idea of the languages and which portions was NOT done in erlang. NOT USED SNMP / Megaco / ASN / CORBA / WEB / MNESIA Mnesia and WEB - is on the list to be included in the next release. USED OTP, gen_servers, gen_tcp, applications, failovers, crypto, erl interface - almost everything else. - what improvements did you observe compared to previous, non-Erlang, projects? We used an extreme programming methodology - and we saw a rapid time to market. Very cost effective solution - our banking solution is about 30% - 50% the cost of similar banking solutions. Modules gave us: Smaller code, easier maintenance, quick testing and integration. Erlang OTP gave us: beter version control and configuration management robustness functionality that is a given - ei it works (real time code updates, node failover) - are you glad you chose Erlang, will you continue with Erlang, and would you recommend Erlang to others? Glad is an understatement - it is a very solid solution. (Not to say other solutions are NOT - our choices worked out fine on the project) Currently - we are gearing to become an Erlang house - we are increasing our coding staff complement from 3 to 12 as we have acquired additional project with similar requirements, and Erlang as the back end to these solutions seems like the right way to go. We are however selective on the projects. Just because we've got a "silver bullet" doesn't imply that all projects are werewolves :) Personally - we are recommending erlang to almost everyone - as long as it fits the project needs. Any other / further questions - please let me know Regards Danie Schutte Danie Schutte Phone: +27 - 11 - 203 - 1613 Mobile: 084-468-3138 e-Mail: Daniesc@REDACTED >>> D.WILLIAMS@REDACTED 02/04/03 09:58AM >>> > From: DANIESC SCHUTTE [mailto:DANIESC.SCHUTTE@REDACTED] > > What kind of information would be required. I've got > permission from the CEO of Teba Bank (South Africa) to > disclose "relevant" information. We would like to let the > Erlang community know about this - (we've been approached for > an adaptation for a gsm cellular billing system integration - > and would like to have input / advice on this as well in > order to futher the solutions possibilities.) As I am currently considering adopting Erlang for a project, I would be interested to know: - what were you using before? - why did you choose Erlang? - how long did the team take to learn Erlang and become productive? - how many members of the team had previous Erlang experience? - a brief description of the system's architecture, and the parts of Erlang that were used or not used. - what improvements did you observe compared to previous, non-Erlang, projects? - are you glad you chose Erlang, will you continue with Erlang, and would you recommend Erlang to others? Thanks, Dominic. ##################################################################################### The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy and copies. ##################################################################################### From eleberg@REDACTED Tue Feb 4 10:51:40 2003 From: eleberg@REDACTED (Bengt Kleberg) Date: Tue, 4 Feb 2003 10:51:40 +0100 (MET) Subject: Publicity Message-ID: <200302040951.h149peH06227@cbe.ericsson.se> > X-Authentication-Warning: enfield.sics.se: joe owned process doing -bs > Date: Tue, 4 Feb 2003 10:09:19 +0100 (CET) > From: Joe Armstrong > To: erlang-questions@REDACTED > > I have for a long time thought that this mailing list should have a > more public face - are there any opinion for or against a move to a > usenet group or something else, for example a yahoo group etc. the email list for inferno is hosted by www.topica.com. i do not know if this has in any way created more publicity for inferno. it does give a web interface and a possiblity to search past messages. google does not find the list when looking for inferno. bengt From enano@REDACTED Tue Feb 4 11:06:48 2003 From: enano@REDACTED (Miguel Barreiro Paz) Date: Tue, 4 Feb 2003 11:06:48 +0100 (CET) Subject: Publicity In-Reply-To: References: Message-ID: > I have for a long time thought that this mailing list should have a > more public face - are there any opinion for or against a move to a > usenet group or something else, for example a yahoo group etc. > > Alternatively - we could keep things as they are and add gateway > functions into other forums - we could also do stuff to increase > chances that google indexes posting to this mailing list. My 2 (euro) cents: keep things as they are, and add gateways. Usenet forums are incredibly crowded with spam (and harvested for new addresses daily by spammers). Many news feeds also have a significant lag. Suggestion: a "mailing list" link on the left side of the main erlang.org page (where the "Documentation", "Examples", etc are). A google search of "erlang" returns erlang.org in the first place. A google search of "telecom development platform" returns Ericsson Review (article on OTP) in second place, then OTP at ericsson.com next (no erlang.org or erlang.se, but not bad). But just turn that into "telecommunications development platform" and the first erlang match is at pos 19. Regards, Miguel From enano@REDACTED Tue Feb 4 11:13:00 2003 From: enano@REDACTED (Miguel Barreiro Paz) Date: Tue, 4 Feb 2003 11:13:00 +0100 (CET) Subject: non-telecom in erlang In-Reply-To: References: Message-ID: > What kind of information would be required. I've got permission from Mickael and Dominic have already done a great job interrogating you :-) Just one question: how did you convince management? Regards, Miguel From mickael.remond@REDACTED Tue Feb 4 11:19:37 2003 From: mickael.remond@REDACTED (Mickael Remond) Date: Tue, 4 Feb 2003 11:19:37 +0100 Subject: Erlang projects association In-Reply-To: <00a001c2cc1e$ba48bed0$87ea1ec4@moneymaker> References: <20030203135121.GA21096@mremond.cgey.capgemini.fr> <00a001c2cc1e$ba48bed0$87ea1ec4@moneymaker> Message-ID: <20030204101937.GE3117@mremond.cgey.capgemini.fr> * Valentin [2003-02-04 09:26:25 +0200]: > > - We should not have limited this initiative to France. > Does this mean that your association did not attract the critical mass in > France? > If so, why, in your opinion, it didn't? Because, even if Erlang community is growing, let's face it, is it still a small community. And it was even more small 2 years and a half ago when Erlang-fr was started. > > - We did not pay enough attention to the fact that promoting Erlang is > > currently a very difficult task without a proper understanding of the > > real expectations of both the users and the developers. > > Maybe you should lead by an example, and tell us what are yours (personal) > expectations from such an organization/association. I am not speaking of expectations regarding the organisation. I am speaking of expectations regarding the language itself, the satelite project that are popping up elsewhere, etc. You know the language competition is really fierce. The last ten years have considerably pushed forward the development language. We have seen Perl, Python, PHP, C#, Java, Ruby, Rebol, and many, many more. The organisation should provide added value to members and more largely to the rest of the Erlang community to attract more developer, have new reference, see new successful project, etc... > >That's why we have decided to create an association to pragmatically > > work on those issues. > > How does one work "pragmatically on those issues". Can you be a bit more > specific? This means that this should not be a "place" where we only think about how Erlang should be and how even cooler it could become, but were we will be doing things. I will take an example. Many people think that are expecting Erlang tools could go further in web development. Yaws has made this idea sensitive, but we still need some others things. One of the step would be to think about what we are missing the most regarding web development. What are the current work on those issues ? How could we help ? This might leads us to create a dedicated workgroup lead by people willing to promote Erlang as a web development solution. This could be based on a individual based initiative or if some companies wants to invest some times into developing some open source based tools, we could help by providing feedback, testing, maybe specs and code. > > > The main goal of this association is to gather > > users and developers, both individuals and companies to work on projects > > that are needed to help us spread Erlang. > > To what end? Maybe you should try to convince me (and maybe others) how is > my life going to be better if I "join the association". What would I gain > from spreading Erlang -- I understand only my reasons for doing it. I cannot > say that I understand yours... you must articulate it better. Please, I do not want too directive. I really do not want to defend my view but what we need is make emerge a stronger community. I think one of our first thing will be to provide an infrastructure for this community so that every one can express its feeling. They are plenty examples of Web based community that really help pushing the tools further. The infrastructure will be based on erlang-projects.org We are now actively looking for a hosting solution. > In my view, an association can be successful only if the individual members > can align with the goals. We might as well help spread peanut butter on (or > to) China. And what would be the benefit of doing it? I disagree. For exemple go to http://www.zope.org/. This is a big, huge community web site around the Zope project. Do you think all the members have the same goals ? Not at all. But they all contribute to making the software a great, properly supported product, with a lot of things happening around it. Go on http://www.python.org/ They provide commercial links for active companies in the community. They provide special Software interest group (SIG) for specific important area for the development of the language. All the member does not have the same goal, but they collaborate together by the discussion and thus are making the "thing" happening. I hope the infrastructure we are going to set up is going to have the same effect on Erlang development. And please do not read the following as buzzwords, but as something that I feel: The association is not intended to have a central and unique way to see the Erlang world, but as a facilitator to make things happens. To get back to your point, yes, you might have a clear view of what YOU should e spreading Erlang and think that other approach are useless. I feel this is not true and that all our visions compose the big Erlang picture. > > The first tasks will be to identify the major domains for which Erlang > > should shine. We will then start dedicated workgroups that will have to > > identify existing relevant projects and to help them go further. > > I suppose you have funding for that? No. Not a cents but I hope we are going to be clever. I think we will not need many funds. And we will start looking for way to gets funds if we need more of them. But association member might be clever enough to help making the things happen. -- Micka?l R?mond From DANIESC.SCHUTTE@REDACTED Tue Feb 4 11:28:41 2003 From: DANIESC.SCHUTTE@REDACTED (DANIESC SCHUTTE) Date: Tue, 04 Feb 2003 12:28:41 +0200 Subject: non-telecom in erlang Message-ID: Hello Miguel, Fly me out - and I'll show you in 2 hours. :) That was an initial concern, but I head the technical team and also have voting power in the business side :). Seriously: We did some initial prototyping and a lot of reading and internal selling based on the information we could gather. (Within the first month of learning / playing - only the initial specifications was designed - so no physical coding was done - so by the time we started with the coding we could prove with prototypes that some of the stuff would be easier and less coding was required.) I must admit - the nice OTP directory structure with starting using a boot script only came on board in October / November last year - but now it works. Regards Daniel Schutte Danie Schutte Phone: +27 - 11 - 203 - 1613 Mobile: 084-468-3138 e-Mail: Daniesc@REDACTED >>> Miguel Barreiro Paz 02/04/03 12:13PM >>> > What kind of information would be required. I've got permission from Mickael and Dominic have already done a great job interrogating you :-) Just one question: how did you convince management? Regards, Miguel ##################################################################################### The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy and copies. ##################################################################################### From Vlad.Dumitrescu@REDACTED Tue Feb 4 11:36:43 2003 From: Vlad.Dumitrescu@REDACTED (Vlad Dumitrescu (EAW)) Date: Tue, 4 Feb 2003 11:36:43 +0100 Subject: Erlang projects association Message-ID: <5F03ACA2F76DD411B8BC00508BE3B4D71200F73A@esemont203.gbg.edt.ericsson.se> > I hope the infrastructure we are going to set up is going to have the > same effect on Erlang development. > And please do not read the following as buzzwords, but as > something that > I feel: The association is not intended to have a central and > unique way > to see the Erlang world, but as a facilitator to make things happens. I think it is a good idea. Just one question, for now: why not use www.erlang.org? Does Ericsson own the domain and the site? It might be a little confusing with both erlang.org and erlang-projects.org... As far as I can tell, erlang.org's purpose it exactly the one Mickael described - why not use it? If it would be possible to open the site such that not only the OTP team can edit it and set up the needed tools, then I think it should work just as well! Then the hosting problem is solved! ;-p regards, Vlad From LHL@REDACTED Tue Feb 4 11:40:49 2003 From: LHL@REDACTED (Lars H. Larsen, ICCC) Date: Tue, 04 Feb 2003 11:40:49 +0100 Subject: Client/server Bad value on output port 'tcp_inet' Message-ID: Hello fabulous Erlang guys I'm using OTP R9-0 on a Win32 platform (winsock) W2K and XP When I run a balanced client-server program ( attached below) the connection phase is resolved with no problems. But the data exchange never happens due to some strange error I have been chasing now for a week or so, -until now with no luck.... :-( in Desperation I loaded the program with debug outputs : All the debug output give approx. this result on both sides when connecting from 'knud2' to 'lhl-pc' accsocket init <0.72.0>,knud2 6000 accsocket: gen_tcp:connect(knud2,6000),{packet, 0},{active, true } Connect error {reason,econnrefused} gen_tcp:listen (6000,[binary, {packet, 0}, {active,true}]) ok,ListenSocket ListenSocket=#Port<0.118> info ={error,enotconn} runing initServer got Connect Socket #Port<0.119> Info {ok,{{192,168,2,253}, 6000}} GETACCTABLE Socket#socket.socket #Port<0.119> Data {[255,0,0,2]} accsocket:send(#Port<0.119>,{[255,0,0,2]}) accsock:error Reasson einval =ERROR REPORT==== 4-Feb-2003::11:23:55 === Bad value on output port 'tcp_inet' - the ERROR thing text is repeated for every data send attempt regards Software developer Lars H. Larsen ICCC A/S M?l?vhovedgade 88 2760 M?l?v Denmark http://www.iccc.dk mailto:lhl@REDACTED tel:+45 44860400 GSM +45 51901320 here is a printout of the program accsocket.erl, the real fun happens in function socketLoop/1 ========================================================== cut here -define(module, accsocket). % The name of this module. -module(?module). -compile({module_info, [{identity, '@(#)AccSocket/R4A01'}]}). -author('LMDPLU@REDACTED'). -export([socketLoop/1, init/3, initServer/3]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Constants. %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Definition of the alarm numbers used in the alarmlist.def file -define(alarmbase, 1500 ). -define(unknownMessageReceived, ?alarmbase+1 ). -define(accGwWentDown, ?alarmbase+31). -define(socketTransmissionError, ?alarmbase+32). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Records. %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -define(loopRecordName, socket).% To be used in the record definition and in % the debug.hrl file. -record( ?loopRecordName, { socket = unknown, % The Socket reference. gwPid, % The Pid of the 'ACCGW' process. ipAddress, % The ip address of the socket process. socketPort, % The socket port used to communicate ... restData = [], % The Pid of the 'ACCGW' process. hostType, % The type of the socket connection [server|client]. logSocketCommand = #log{eventLevel=210, eventString="ACCSOCKET: Command decoded: "}, logSocketData = #log{eventLevel=210, eventString="ACCSOCKET: SocketData received: "}, logAlarm = #log{eventLevel=255, eventString="ACCSOCKET Alarm: "} }). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Debug functions and records. %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -define(regName, 'ACCSOCKET'). % The registerred name. -include("debug.hrl"). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% Function : init/3 %% Purpose : initiates the socket from the gateway. %% Args : Port - Variable containing the port number the gateway will use for sockets %% Return : Spawns 2 processes, a client and a server. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% init(GwPid, IpAddress, Port) when pid(GwPid), atom(IpAddress), integer(Port)-> io:fwrite("accsocket init ~p,~p ~p ~n",[GwPid, IpAddress, Port]), process_flag(trap_exit, true), register(?regName, self()), %LHL socket:start(), initClientLoop(#socket{gwPid=GwPid, ipAddress=IpAddress, socketPort=Port, hostType=client}); init(_, _, _) -> io:fwrite("Bad parameter"). initClientLoop(SocketRec)-> timer:sleep(100), % Please don't ask why ! io:format("accsocket: gen_tcp:connect(~w,~w),{packet, 0},{active, true }~n",[SocketRec#socket.ipAddress, SocketRec#socket.socketPort]), case catch gen_tcp:connect(SocketRec#socket.ipAddress, SocketRec#socket.socketPort, [binary,{packet,0},{active,true}]) of {error, _R} -> io:format("Connect error {reason,~w} ~n",[_R]), ServerPid = spawn_link(?module, initServer, [self(), SocketRec#socket.ipAddress, SocketRec#socket.socketPort]), initServerLoop(SocketRec#socket{hostType=server}, ServerPid); {'EXIT', _Reason} -> io:format("Connect EXIT {reason,~w} ~n",[_Reason]), ServerPid = spawn_link(?module, initServer, [self(), SocketRec#socket.ipAddress, SocketRec#socket.socketPort]), initServerLoop(SocketRec#socket{hostType=server}, ServerPid); {ok,Socket} -> io:format("runing initclient got Connect ~p ~n",[Socket]), SocketRec#socket.gwPid ! {'SOCKETSTATE',active}, socketLoop(SocketRec#socket{socket = Socket}) end. initServerLoop(SocketRec, ServerPid)-> receive {'EXIT', ServerPid, Reason} -> io:format("{'EXIT', ServerPid, Reason}: ~p ~n",[Reason]), initClientLoop(SocketRec#socket{hostType=client}); {'EXIT', GwPid, Reason} -> alarmmgr:notify(?accGwWentDown, [?MODULE, ?LINE, Reason]), log(SocketRec, logAlarm, {notify, ?accGwWentDown, ?MODULE, ?LINE, [Reason]}), exit(Reason); {'ACCSOCKETCONNECT', ServerPid, Socket} -> SocketRec#socket.gwPid ! {'SOCKETSTATE', active}, socketLoop(SocketRec#socket{socket = Socket}); {'UPDATECODE', Module} -> unlink(ServerPid), exit(ServerPid, kill), case Module of ?module -> ?module:initClientLoop(SocketRec#socket{hostType=client}); _Module -> initClientLoop(SocketRec#socket{hostType=client}) end; {'SHUTDOWN', Pid} -> unlink(ServerPid), exit(ServerPid, kill), % io:fwrite(' SHUTDOWN request sent from ACCGW '), Pid ! {'SHUTDOWNOK',self()}, initClientLoop(SocketRec#socket{hostType=client}); %------------------------ Debug Functionallity --------------------------% {getLoopData, Pid} -> Pid ! {loopData, SocketRec}, initServerLoop(SocketRec, ServerPid); {logState, LogRecord, NewValue} -> NewSocketRec = logStateChange(SocketRec, LogRecord, NewValue), initServerLoop(NewSocketRec, ServerPid); {logToScreen, LogRecord, NewValue} -> NewSocketRec = logToScreenChange(SocketRec, LogRecord, NewValue), initServerLoop(NewSocketRec, ServerPid); {logLevel, LogRecord, NewValue} -> NewSocketRec = logLevelChange(SocketRec, LogRecord, NewValue), initServerLoop(NewSocketRec, ServerPid); exit -> ok; Other -> io:format("SocketLoop Other: ~p ~n",[Other]), alarmmgr:notify(?unknownMessageReceived, [?MODULE, ?LINE, Other]), log(SocketRec, logAlarm, {notify, ?unknownMessageReceived, ?MODULE, ?LINE, [Other]}), initServerLoop(SocketRec, ServerPid) % after TimeOut -> % unlink(ServerPid), % exit(ServerPid, kill), % initClientLoop(SocketRec#socket{hostType=client}) end. initServer(Initiator, IpAddress, Port)-> %LHL ListenSocket = socket:listen('STREAM', 'AF_INET', Port, {packet, 0}), io:format("gen_tcp:listen (~w,[binary, {packet, 0}, {active,true}])~n",[Port]), case catch gen_tcp:listen(Port,[binary, {packet, 0}, {active,true}]) of {error,Reason} -> io:format("Exit in listen (~w) ~n",[Reason]), exit(normal); {ok,ListenSocket} -> io:format("ok,ListenSocket ListenSocket=~p info =~p~n",[ListenSocket,inet:peername(ListenSocket)]), case catch gen_tcp:accept(ListenSocket) of {error, Reason} -> io:format("Error gen_tcp:accept Reason~p ~n",[Reason]), %gen_tcp:close(ListenSocket), exit(normal); {ok,Socket}-> io:format("runing initServer got Connect Socket ~p Info ~p~n",[Socket,inet:sockname(Socket)]), Initiator ! {'ACCSOCKETCONNECT', self(), Socket}, %LHL socket:controlling_process(Socket, Initiator), gen_tcp:controlling_process(Socket, Initiator), unlink(Initiator), gen_tcp:close(ListenSocket), ok end end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% Function : socketLoop/4 %% Purpose : Loop that sends and receive data. %% Args : Socket - loop data %% Return : -- %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% socketLoop(Socket) -> receive {tcp,SocketPid, SocketData} when SocketPid == Socket#socket.socket -> log(Socket, logSocketData, SocketData), io:format("Data from socket ~p~n",[SocketData]), case accDecode(lists:flatten([Socket#socket.restData|SocketData])) of {reply, Data} -> log(Socket, logSocketCommand, {'NEWACCTABLE', Data}), Socket#socket.gwPid ! {'NEWACCTABLE', Data}, socketLoop(Socket#socket{restData=[]}); {request} -> log(Socket, logSocketCommand, {'GETACCTABLE'}), Socket#socket.gwPid ! {'GETACCTABLE'}, socketLoop(Socket#socket{restData=[]}); {splitData, {reply, Data}, RestData} -> log(Socket, logSocketCommand, [{'NEWACCTABLE', Data}, RestData]), Socket#socket.gwPid ! {'NEWACCTABLE', Data}, socketLoop(Socket#socket{restData=RestData}); {splitData, {request}, RestData} -> log(Socket, logSocketCommand, [{'GETACCTABLE'}, RestData]), Socket#socket.gwPid ! {'GETACCTABLE'}, socketLoop(Socket#socket{restData=RestData}); {packetNotEnded, RestData} -> socketLoop(Socket#socket{restData=RestData}); {error, invalidPacket} -> alarmmgr:notify(?socketTransmissionError, [?MODULE, ?LINE, [Socket#socket.restData|SocketData]]), log(Socket, logAlarm, {notify, ?socketTransmissionError, ?MODULE, ?LINE, [Socket#socket.restData|SocketData]}), socketLoop(Socket#socket{restData=[]}) end; {tcp_closed,SocketPid} when SocketPid == Socket#socket.socket -> io:format("socket_closed,normal~n"), exit(normal); {tcp_error,SocketPid,Error} when SocketPid == Socket#socket.socket -> io:format("socket_closed,Error ~p~n",[Error]), exit(Error); {'GETACCTABLE'} -> Data= {[255, 0, 0, 2]}, io:format("GETACCTABLE Socket#socket.socket ~p Data ~p~n",[Socket#socket.socket,Data]), send(Socket#socket.socket,Data), % LHL Socket#socket.socket ! {self(),{deliver,[255, 0, 0, 2]}}, socketLoop(Socket); {'NEWACCTABLE', Data} -> Data1 = accEncode(Data), io:format("NEWACCTABLE Socket#socket.socket ~p Data1 ~p~n",[Socket#socket.socket,Data1]), send(Socket#socket.socket,Data1), socketLoop(Socket); {'EXIT', Pid, Reason} when Pid == Socket#socket.gwPid -> alarmmgr:notify(?accGwWentDown, [?MODULE, ?LINE, Reason]), log(Socket, logAlarm, {notify, ?accGwWentDown, ?MODULE, ?LINE, [Reason]}), exit(Reason); {'UPDATECODE', ?module} -> ?module:socketLoop(Socket); {'UPDATECODE', Module} -> socketLoop(Socket); {'SHUTDOWN', Pid} -> % io:fwrite(' SHUTDOWN request sent from ACCGW '), Pid ! {'SHUTDOWNOK',self()}, socketLoop(Socket); %------------------------ Debug Functionallity --------------------------% {getLoopData, Pid} -> Pid ! {loopData, Socket}, socketLoop(Socket); {logState, LogRecord, NewValue} -> NewSocket = logStateChange(Socket, LogRecord, NewValue), socketLoop(NewSocket); {logToScreen, LogRecord, NewValue} -> NewSocket = logToScreenChange(Socket, LogRecord, NewValue), socketLoop(NewSocket); {logLevel, LogRecord, NewValue} -> NewSocket = logLevelChange(Socket, LogRecord, NewValue), socketLoop(NewSocket); exit -> ok; Other -> alarmmgr:notify(?unknownMessageReceived, [?MODULE, ?LINE, Other]), log(Socket, logAlarm, {notify, ?unknownMessageReceived, ?MODULE, ?LINE, [Other]}), socketLoop(Socket) end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Function : accDecode/1 %%% %%% Purpose : Checks and deocode the received packets from the other call centre, and %%% sends them to Alternative Call Centre Gateway (ACCGW). %%% %%% Args : [255, Length1, Length2, Command | DataList] - The list, which is received to be decoded. %%% 255 is a flag indicating start of the packet. %%% Lenght1 and Lenght2 are representing the total %%% lenght of the packet. %%% Command is type os the packet, which either is %%% 1 indicating "reply" or 2 indicating "request". %%% DataList is a list of tuples of Service Type and %%% the expected queuing time. %%% Return : error - The received packet is not valid. %%% {reply, decodeElements(DataList)} - "reply" is the type of the packet,and the value of %%% decodeElements(DataList) is decoded received data. %%% %%% {request} - "request" is the type of the packet. %%% %%% {packetNotEnded, DataList} - "packetNotEnded" indicates that the received packet is too short. %%% %%% {splitData, accDecode(NewDataList), RestData} - "splitData" indicates the received packet had %%% been too long, and is splitet into "NewDataList" %%% and "RestData". %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% accDecode([255,0,0,2]) -> {request}; accDecode([255, Length1, Length2, 1 | DataList]) -> Length = (Length1 * 256) + Length2, case decodeList(Length, DataList) of packetOK -> {reply, decodeElements(DataList)}; packetNotEnded -> {packetNotEnded, DataList}; {packetTooLong, {NewDataList, RestData}} -> {splitData, accDecode(NewDataList), RestData} end; accDecode(_) -> {error, invalidPacket}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Function : splitList/2 %%% %%% Purpose : Split a list into two at a specified length. %%% %%% Args : List - The list, which is to be splitet into two. %%% Splitpoint - The number of enteries before splitting. %%% %%% Return : {FirstList, SecondList} - FirstList is the list before the %%% split point. SecondList is the %%% remainder of the list after the split point. %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% splitList(List, SplitPoint) -> splitList(List, SplitPoint, []). splitList([H | RestOfList], N, FirstList) when N > 0 -> splitList(RestOfList, N - 1, [H | FirstList]); splitList(SecondList, 0, FirstList) -> {lists:reverse(FirstList), SecondList}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Function : decodeList/2 %%% %%% Purpose : Checks the lenght of the data and call the split fucntion, if the %%% data is too long. %%% %%% Args : Length - The total length of the data. %%% %%% Return : packetNotEnded - Indicates that the received packet is too short. %%% {packetTooLong, splitList(DList, Length)} - "packetTooLong" indicates %%% the list/data is too long, %%% and has to be splitet. %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% decodeList(Length, DList) -> ListLength = length(DList), case Length of ListLength -> packetOK; N when N > ListLength -> packetNotEnded; _ -> {packetTooLong, splitList(DList, Length)} end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Function : decodeElement/1 %%% %%% Purpose : Decode the list into a list of tuples of two elements. %%% %%% Args : List - A flatten list. %%% %%% Return : Data - A list of tuples of Service Type and expected queuing time.. %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% decodeElements([]) -> []; decodeElements([ServT1, ServT2, QT1, QT2 | Tail]) -> decodeElements([ServT1, ServT2, QT1, QT2 | Tail], []). decodeElements([ServT1, ServT2, QT1, QT2 | Tail], Data) -> NewData = [{ServT1 * 256 + ServT2, QT1 *256 + QT2} | Data], decodeElements(Tail, NewData); decodeElements([], Data) -> Data. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Function: accEncode/1 & /2 %%% %%% Purpose : Encode the received OCC tuple to be a list of bytes including %%% a start flag (255) length of data and 1 for request. %%% %%% Args : Data - A list of tuples to be encoded. %%% %%% Return : [255, 0, 0, 1] or [255, Length1, Length2, 1 | EncodedData)] %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% accEncode(Data) -> accEncode(Data, []). accEncode([], []) -> [255, 0, 0, 1]; accEncode([], EncodedData) -> Length = length(EncodedData), Length1 = Length div 256, Length2 = Length rem 256, [255, Length1, Length2, 1 | EncodedData]; accEncode([{ServiceType, QueueTime}|RestData], EncodedData) -> accEncode(RestData, [ServiceType div 256, ServiceType rem 256, QueueTime div 256, QueueTime rem 256 | EncodedData]). send(Socket, Data)-> io:format("accsocket:send(~p,~p)~n",[Socket,Data]), erlang:ports(), case gen_tcp:send(Socket, Data) of % Socket ! {self(), Data}. ok -> io:format("accsock:send-> ok~n"), ok; {error, Reason} -> s io:format("accsock:error Reasson ~p~n",[Reason]), erlang:ports(), exit(Reason) end. From Chandrashekhar.Mullaparthi@REDACTED Tue Feb 4 11:54:05 2003 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Tue, 4 Feb 2003 10:54:05 -0000 Subject: Client/server Bad value on output port 'tcp_inet' Message-ID: Lars, accsocket:send(#Port<0.119>,{[255,0,0,2]}) accsock:error Reasson einval You are trying to send a tuple down the socket. It will accept only binaries and lists. hth Chandru -----Original Message----- From: Lars H. Larsen, ICCC [mailto:LHL@REDACTED] Sent: 04 February 2003 10:41 To: erlang-questions@REDACTED Subject: Client/server Bad value on output port 'tcp_inet' Hello fabulous Erlang guys I'm using OTP R9-0 on a Win32 platform (winsock) W2K and XP When I run a balanced client-server program ( attached below) the connection phase is resolved with no problems. But the data exchange never happens due to some strange error I have been chasing now for a week or so, -until now with no luck.... :-( in Desperation I loaded the program with debug outputs : All the debug output give approx. this result on both sides when connecting from 'knud2' to 'lhl-pc' accsocket init <0.72.0>,knud2 6000 accsocket: gen_tcp:connect(knud2,6000),{packet, 0},{active, true } Connect error {reason,econnrefused} gen_tcp:listen (6000,[binary, {packet, 0}, {active,true}]) ok,ListenSocket ListenSocket=#Port<0.118> info ={error,enotconn} runing initServer got Connect Socket #Port<0.119> Info {ok,{{192,168,2,253}, 6000}} GETACCTABLE Socket#socket.socket #Port<0.119> Data {[255,0,0,2]} accsocket:send(#Port<0.119>,{[255,0,0,2]}) accsock:error Reasson einval =ERROR REPORT==== 4-Feb-2003::11:23:55 === Bad value on output port 'tcp_inet' - the ERROR thing text is repeated for every data send attempt 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 joe@REDACTED Tue Feb 4 12:18:40 2003 From: joe@REDACTED (Joe Armstrong) Date: Tue, 4 Feb 2003 12:18:40 +0100 (CET) Subject: non-telecom in erlang In-Reply-To: Message-ID: ... cut ... > f) BRILLIANT SUPPORT - with the guys responding to some of our queries in less than 15 minutes on an opensource project - that is why the budget this year includes licensing fees :). Thats nothing - As you can see from the log below Chandrashekhar Mullaparthi answered a question of Lars Larsen 46 minutes *before* he asked the question. Not bad :-) /Joe Date: Tue, 4 Feb 2003 10:54:05 -0000 From: Chandrashekhar Mullaparthi To: "'Lars H. Larsen, ICCC'" , erlang-questions@REDACTED Subject: RE: Client/server Bad value on output port 'tcp_inet' Date: Tue, 04 Feb 2003 11:40:49 +0100 From: "Lars H. Larsen, ICCC" To: erlang-questions@REDACTED Subject: Client/server Bad value on output port 'tcp_inet' From matthias@REDACTED Tue Feb 4 12:23:02 2003 From: matthias@REDACTED (Matthias Lang) Date: Tue, 4 Feb 2003 12:23:02 +0100 Subject: Client/server Bad value on output port 'tcp_inet' In-Reply-To: References: Message-ID: <15935.41622.820568.307039@antilipe.corelatus.se> Lars H. Larsen, ICCC writes: > I'm using OTP R9-0 on a Win32 platform (winsock) W2K and XP > accsocket:send(#Port<0.119>,{[255,0,0,2]}) > accsock:error Reasson einval Chandru has already pointed out that you can't pass a tuple as the second argument to gen_tcp:send/2. You're generating the tuple here: > {'GETACCTABLE'} -> > Data= {[255, 0, 0, 2]}, Looking through the module, it looks like it would be a bit clearer if you used the binary syntax, e.g. instead of writing > accDecode([255, Length1, Length2, 1 | DataList]) -> > Length = (Length1 * 256) + Length2, you could write accDecode(<<255, Length:16, 1, Data/binary>>) N.b: the above is _not_ a list. See: http://www.erlang.org/doc/r9b/doc/extensions/bit_syntax.html Matthias From mike@REDACTED Tue Feb 4 12:45:18 2003 From: mike@REDACTED (Mike Williams) Date: 4 Feb 2003 11:45:18 GMT Subject: Publicity References: Message-ID: In article , joe@REDACTED (Joe Armstrong) writes: |> |> I have for a long time thought that this mailing list should have a |> more public face - are there any opinion for or against a move to a |> usenet group or something else, for example a yahoo group etc. Whatever, but not a usenet group or any other publication method which makes people's e-mail address available to the spam merchants. /mike From Vlad.Dumitrescu@REDACTED Tue Feb 4 12:52:30 2003 From: Vlad.Dumitrescu@REDACTED (Vlad Dumitrescu (EAW)) Date: Tue, 4 Feb 2003 12:52:30 +0100 Subject: Publicity Message-ID: <5F03ACA2F76DD411B8BC00508BE3B4D71200F73B@esemont203.gbg.edt.ericsson.se> > Whatever, but not a usenet group or any other publication method which > makes people's e-mail address available to the spam merchants. Erm.... the archived version of the mailing list contains the email addresses in clear (and is searchable with Google). So the only difference is that not too many spammers did found the archives. I think it should be easy to mask out the adresses, maybe even in already archived data? regards, Vlad From per@REDACTED Tue Feb 4 12:09:33 2003 From: per@REDACTED (Per Bergqvist) Date: Tue, 04 Feb 2003 12:09:33 +0100 Subject: Client/server Bad value on output port =?iso-8859-1?q?'tcp=5Finet'?= In-Reply-To: Message-ID: <200302041109.h14B9Yo14110@sork.levonline.com> Hi, It looks like you are trying to send a tuple. Don't. /Per > Hello fabulous Erlang guys > > I'm using OTP R9-0 on a Win32 platform (winsock) W2K and XP > > When I run a balanced client-server program ( attached below) the connection phase is resolved with no problems. > But the data exchange never happens due to some strange error I have been chasing now for a week or so, > -until now with no luck.... :-( > > in Desperation I loaded the program with debug outputs : All the debug output give approx. this result on both sides when connecting from 'knud2' to 'lhl-pc' > > accsocket init <0.72.0>,knud2 6000 > accsocket: gen_tcp:connect(knud2,6000),{packet, 0},{active, true } > Connect error {reason,econnrefused} > gen_tcp:listen (6000,[binary, {packet, 0}, {active,true}]) > ok,ListenSocket ListenSocket=#Port<0.118> info ={error,enotconn} > runing initServer got Connect Socket #Port<0.119> Info {ok,{{192,168,2,253}, > 6000}} > GETACCTABLE Socket#socket.socket #Port<0.119> Data {[255,0,0,2]} > accsocket:send(#Port<0.119>,{[255,0,0,2]}) > accsock:error Reasson einval > > =ERROR REPORT==== 4-Feb-2003::11:23:55 === > Bad value on output port 'tcp_inet' > > - the ERROR thing text is repeated for every data send attempt > > > regards > Software developer > Lars H. Larsen > ICCC A/S > M?l?vhovedgade 88 > 2760 M?l?v > Denmark > http://www.iccc.dk > mailto:lhl@REDACTED > tel:+45 44860400 > GSM +45 51901320 > > > here is a printout of the program accsocket.erl, the real fun happens in function socketLoop/1 > > ========================================================== cut here > > -define(module, accsocket). % The name of this module. > -module(?module). > -compile({module_info, [{identity, '@(#)AccSocket/R4A01'}]}). > > -author('LMDPLU@REDACTED'). > > -export([socketLoop/1, init/3, initServer/3]). > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% > %%% > %%% Constants. > %%% > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% > > % Definition of the alarm numbers used in the alarmlist.def file > -define(alarmbase, 1500 ). > -define(unknownMessageReceived, ?alarmbase+1 ). > -define(accGwWentDown, ?alarmbase+31). > -define(socketTransmissionError, ?alarmbase+32). > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% > %%% > %%% Records. > %%% > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% > > -define(loopRecordName, socket).% To be used in the record definition and in > % the debug.hrl file. > > -record( ?loopRecordName, > { socket = unknown, % The Socket reference. > gwPid, % The Pid of the 'ACCGW' process. > ipAddress, % The ip address of the socket process. > socketPort, % The socket port used to communicate ... > restData = [], % The Pid of the 'ACCGW' process. > hostType, % The type of the socket connection [server|client]. > logSocketCommand = #log{eventLevel=210, eventString="ACCSOCKET: Command decoded: "}, > logSocketData = #log{eventLevel=210, eventString="ACCSOCKET: SocketData received: "}, > logAlarm = #log{eventLevel=255, eventString="ACCSOCKET Alarm: "} > }). > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% > %%% > %%% Debug functions and records. > %%% > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% > > -define(regName, 'ACCSOCKET'). % The registerred name. > -include("debug.hrl"). > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%% > %% > %% Function : init/3 > %% Purpose : initiates the socket from the gateway. > %% Args : Port - Variable containing the port number the gateway will use for sockets > %% Return : Spawns 2 processes, a client and a server. > %% > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%% > init(GwPid, IpAddress, Port) when pid(GwPid), atom(IpAddress), integer(Port)-> > io:fwrite("accsocket init ~p,~p ~p ~n",[GwPid, IpAddress, Port]), > process_flag(trap_exit, true), > register(?regName, self()), > %LHL socket:start(), > initClientLoop(#socket{gwPid=GwPid, ipAddress=IpAddress, socketPort=Port, hostType=client}); > > init(_, _, _) -> > io:fwrite("Bad parameter"). > > > initClientLoop(SocketRec)-> > timer:sleep(100), % Please don't ask why ! > > io:format("accsocket: gen_tcp:connect(~w,~w),{packet, 0},{active, true }~n",[SocketRec#socket.ipAddress, SocketRec#socket.socketPort]), > case catch gen_tcp:connect(SocketRec#socket.ipAddress, SocketRec#socket.socketPort, [binary,{packet,0},{active,true}]) of > {error, _R} -> > io:format("Connect error {reason,~w} ~n",[_R]), > ServerPid = spawn_link(?module, initServer, [self(), SocketRec#socket.ipAddress, SocketRec#socket.socketPort]), > initServerLoop(SocketRec#socket{hostType=server}, ServerPid); > > {'EXIT', _Reason} -> > io:format("Connect EXIT {reason,~w} ~n",[_Reason]), > ServerPid = spawn_link(?module, initServer, [self(), SocketRec#socket.ipAddress, SocketRec#socket.socketPort]), > initServerLoop(SocketRec#socket{hostType=server}, ServerPid); > {ok,Socket} -> > io:format("runing initclient got Connect ~p ~n",[Socket]), > SocketRec#socket.gwPid ! {'SOCKETSTATE',active}, > socketLoop(SocketRec#socket{socket = Socket}) > > end. > > initServerLoop(SocketRec, ServerPid)-> > receive > > {'EXIT', ServerPid, Reason} -> > io:format("{'EXIT', ServerPid, Reason}: ~p ~n",[Reason]), > initClientLoop(SocketRec#socket{hostType=client}); > > {'EXIT', GwPid, Reason} -> > alarmmgr:notify(?accGwWentDown, [?MODULE, ?LINE, Reason]), > log(SocketRec, logAlarm, {notify, ?accGwWentDown, ?MODULE, ?LINE, [Reason]}), > exit(Reason); > > {'ACCSOCKETCONNECT', ServerPid, Socket} -> > SocketRec#socket.gwPid ! {'SOCKETSTATE', active}, > socketLoop(SocketRec#socket{socket = Socket}); > > {'UPDATECODE', Module} -> > unlink(ServerPid), > exit(ServerPid, kill), > case Module of > ?module -> > ?module:initClientLoop(SocketRec#socket{hostType=client}); > _Module -> > initClientLoop(SocketRec#socket{hostType=client}) > end; > > {'SHUTDOWN', Pid} -> > unlink(ServerPid), > exit(ServerPid, kill), > % io:fwrite(' SHUTDOWN request sent from ACCGW '), > Pid ! {'SHUTDOWNOK',self()}, > initClientLoop(SocketRec#socket{hostType=client}); > > %------------------------ Debug Functionallity --------------------------% > > {getLoopData, Pid} -> > Pid ! {loopData, SocketRec}, > initServerLoop(SocketRec, ServerPid); > > {logState, LogRecord, NewValue} -> > NewSocketRec = logStateChange(SocketRec, LogRecord, NewValue), > initServerLoop(NewSocketRec, ServerPid); > > {logToScreen, LogRecord, NewValue} -> > NewSocketRec = logToScreenChange(SocketRec, LogRecord, NewValue), > initServerLoop(NewSocketRec, ServerPid); > > {logLevel, LogRecord, NewValue} -> > NewSocketRec = logLevelChange(SocketRec, LogRecord, NewValue), > initServerLoop(NewSocketRec, ServerPid); > > exit -> > ok; > > Other -> > io:format("SocketLoop Other: ~p ~n",[Other]), > alarmmgr:notify(?unknownMessageReceived, [?MODULE, ?LINE, Other]), > log(SocketRec, logAlarm, {notify, ?unknownMessageReceived, ?MODULE, ?LINE, [Other]}), > initServerLoop(SocketRec, ServerPid) > > % after TimeOut -> > % unlink(ServerPid), > % exit(ServerPid, kill), > % initClientLoop(SocketRec#socket{hostType=client}) > > end. > > initServer(Initiator, IpAddress, Port)-> > %LHL ListenSocket = socket:listen('STREAM', 'AF_INET', Port, {packet, 0}), > > io:format("gen_tcp:listen (~w,[binary, {packet, 0}, {active,true}])~n",[Port]), > > case catch gen_tcp:listen(Port,[binary, {packet, 0}, {active,true}]) of > {error,Reason} -> > io:format("Exit in listen (~w) ~n",[Reason]), > exit(normal); > > {ok,ListenSocket} -> > io:format("ok,ListenSocket ListenSocket=~p info =~p~n",[ListenSocket,inet:peername(ListenSocket)]), > case catch gen_tcp:accept(ListenSocket) of > {error, Reason} -> > io:format("Error gen_tcp:accept Reason~p ~n",[Reason]), > %gen_tcp:close(ListenSocket), > exit(normal); > > {ok,Socket}-> > io:format("runing initServer got Connect Socket ~p Info ~~p~n",[Socket,inet:sockname(Socket)]), > Initiator ! {'ACCSOCKETCONNECT', self(), Socket}, > %LHL socket:controlling_process(Socket, Initiator), > gen_tcp:controlling_process(Socket, Initiator), > unlink(Initiator), > gen_tcp:close(ListenSocket), > ok > end > end. > > > > > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%% > %% > %% Function : socketLoop/4 > %% Purpose : Loop that sends and receive data. > %% Args : Socket - loop data > %% Return : -- > %% > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%% > > socketLoop(Socket) -> > receive > {tcp,SocketPid, SocketData} when SocketPid == Socket#socket.socket -> > log(Socket, logSocketData, SocketData), > > io:format("Data from socket ~p~n",[SocketData]), > case accDecode(lists:flatten([Socket#socket.restData|SocketData])) of > {reply, Data} -> > log(Socket, logSocketCommand, {'NEWACCTABLE', Data}), > Socket#socket.gwPid ! {'NEWACCTABLE', Data}, > socketLoop(Socket#socket{restData=[]}); > > {request} -> > log(Socket, logSocketCommand, {'GETACCTABLE'}), > Socket#socket.gwPid ! {'GETACCTABLE'}, > socketLoop(Socket#socket{restData=[]}); > > {splitData, {reply, Data}, RestData} -> > log(Socket, logSocketCommand, [{'NEWACCTABLE', Data}, RestData]), > Socket#socket.gwPid ! {'NEWACCTABLE', Data}, > socketLoop(Socket#socket{restData=RestData}); > > {splitData, {request}, RestData} -> > log(Socket, logSocketCommand, [{'GETACCTABLE'}, RestData]), > Socket#socket.gwPid ! {'GETACCTABLE'}, > socketLoop(Socket#socket{restData=RestData}); > > {packetNotEnded, RestData} -> > socketLoop(Socket#socket{restData=RestData}); > > {error, invalidPacket} -> > alarmmgr:notify(?socketTransmissionError, [?MODULE, ?LINE, [Socket#socket.restData|SocketData]]), > log(Socket, logAlarm, {notify, ?socketTransmissionError, ?MODULE, ?LINE, [Socket#socket.restData|SocketData]}), > socketLoop(Socket#socket{restData=[]}) > > end; > > {tcp_closed,SocketPid} when SocketPid == Socket#socket.socket -> > io:format("socket_closed,normal~n"), > exit(normal); > > {tcp_error,SocketPid,Error} when SocketPid == Socket#socket.socket -> > io:format("socket_closed,Error ~p~n",[Error]), > exit(Error); > > {'GETACCTABLE'} -> > Data= {[255, 0, 0, 2]}, > io:format("GETACCTABLE Socket#socket.socket ~p Data ~~p~n",[Socket#socket.socket,Data]), > send(Socket#socket.socket,Data), > % LHL Socket#socket.socket ! {self(),{deliver,[255, 0, 0, 2]}}, > socketLoop(Socket); > > > {'NEWACCTABLE', Data} -> > Data1 = accEncode(Data), > io:format("NEWACCTABLE Socket#socket.socket ~p Data1 ~~p~n",[Socket#socket.socket,Data1]), > send(Socket#socket.socket,Data1), > socketLoop(Socket); > > {'EXIT', Pid, Reason} when Pid == Socket#socket.gwPid -> > alarmmgr:notify(?accGwWentDown, [?MODULE, ?LINE, Reason]), > log(Socket, logAlarm, {notify, ?accGwWentDown, ?MODULE, ?LINE, [Reason]}), > exit(Reason); > > {'UPDATECODE', ?module} -> > ?module:socketLoop(Socket); > > {'UPDATECODE', Module} -> > socketLoop(Socket); > > {'SHUTDOWN', Pid} -> > % io:fwrite(' SHUTDOWN request sent from ACCGW '), > Pid ! {'SHUTDOWNOK',self()}, > socketLoop(Socket); > > %------------------------ Debug Functionallity --------------------------% > > {getLoopData, Pid} -> > Pid ! {loopData, Socket}, > socketLoop(Socket); > > {logState, LogRecord, NewValue} -> > NewSocket = logStateChange(Socket, LogRecord, NewValue), > socketLoop(NewSocket); > > {logToScreen, LogRecord, NewValue} -> > NewSocket = logToScreenChange(Socket, LogRecord, NewValue), > socketLoop(NewSocket); > > {logLevel, LogRecord, NewValue} -> > NewSocket = logLevelChange(Socket, LogRecord, NewValue), > socketLoop(NewSocket); > > exit -> > ok; > > Other -> > alarmmgr:notify(?unknownMessageReceived, [?MODULE, ?LINE, Other]), > log(Socket, logAlarm, {notify, ?unknownMessageReceived, ?MODULE, ?LINE, [Other]}), > socketLoop(Socket) > > end. > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% > %%% > %%% Function : accDecode/1 > %%% > %%% Purpose : Checks and deocode the received packets from the other call centre, and > %%% sends them to Alternative Call Centre Gateway (ACCGW). > %%% > %%% Args : [255, Length1, Length2, Command | DataList] - The list, which is received to be decoded. > %%% 255 is a flag indicating start of the packet. > %%% Lenght1 and Lenght2 are representing the total > %%% lenght of the packet. > %%% Command is type os the packet, which either is > %%% 1 indicating "reply" or 2 indicating "request". > %%% DataList is a list of tuples of Service Type and > %%% the expected queuing time. > %%% Return : error - The received packet is not valid. > %%% {reply, decodeElements(DataList)} - "reply" is the type of the packet,and the value of > %%% decodeElements(DataList) is decoded received data. > %%% > %%% {request} - "request" is the type of the packet. > %%% > %%% {packetNotEnded, DataList} - "packetNotEnded" indicates that the received packet is too short. > %%% > %%% {splitData, accDecode(NewDataList), RestData} - "splitData" indicates the received packet had > > %%% been too long, and is splitet into "NewDataList" > %%% and "RestData". > %%% > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% > accDecode([255,0,0,2]) -> > {request}; > > accDecode([255, Length1, Length2, 1 | DataList]) -> > Length = (Length1 * 256) + Length2, > case decodeList(Length, DataList) of > packetOK -> > {reply, decodeElements(DataList)}; > packetNotEnded -> > {packetNotEnded, DataList}; > {packetTooLong, {NewDataList, RestData}} -> > {splitData, accDecode(NewDataList), RestData} > end; > > accDecode(_) -> > {error, invalidPacket}. > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% > %%% > %%% Function : splitList/2 > %%% > %%% Purpose : Split a list into two at a specified length. > %%% > %%% Args : List - The list, which is to be splitet into two. > %%% Splitpoint - The number of enteries before splitting. > %%% > %%% Return : {FirstList, SecondList} - FirstList is the list before the > %%% split point. SecondList is the > %%% remainder of the list after the split point. > %%% > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% > splitList(List, SplitPoint) -> > splitList(List, SplitPoint, []). > > splitList([H | RestOfList], N, FirstList) when N > 0 -> > splitList(RestOfList, N - 1, [H | FirstList]); > > splitList(SecondList, 0, FirstList) -> > {lists:reverse(FirstList), SecondList}. > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% > %%% > %%% Function : decodeList/2 > %%% > %%% Purpose : Checks the lenght of the data and call the split fucntion, if the > %%% data is too long. > %%% > %%% Args : Length - The total length of the data. > %%% > %%% Return : packetNotEnded - Indicates that the received packet is too short. > %%% {packetTooLong, splitList(DList, Length)} - "packetTooLong" indicates > %%% the list/data is too long, > %%% and has to be splitet. > %%% > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% > decodeList(Length, DList) -> > ListLength = length(DList), > case Length of > ListLength -> > packetOK; > N when N > ListLength -> > packetNotEnded; > _ -> > {packetTooLong, splitList(DList, Length)} > end. > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% > %%% > %%% Function : decodeElement/1 > %%% > %%% Purpose : Decode the list into a list of tuples of two elements. > %%% > %%% Args : List - A flatten list. > %%% > %%% Return : Data - A list of tuples of Service Type and expected queuing time.. > %%% > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% > decodeElements([]) -> > []; > > decodeElements([ServT1, ServT2, QT1, QT2 | Tail]) -> > decodeElements([ServT1, ServT2, QT1, QT2 | Tail], []). > > > decodeElements([ServT1, ServT2, QT1, QT2 | Tail], Data) -> > NewData = [{ServT1 * 256 + ServT2, QT1 *256 + QT2} | Data], > decodeElements(Tail, NewData); > > decodeElements([], Data) -> > Data. > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% > %%% > %%% Function: accEncode/1 & /2 > %%% > %%% Purpose : Encode the received OCC tuple to be a list of bytes including > %%% a start flag (255) length of data and 1 for request. > %%% > %%% Args : Data - A list of tuples to be encoded. > %%% > %%% Return : [255, 0, 0, 1] or [255, Length1, Length2, 1 | EncodedData)] > %%% > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% > accEncode(Data) -> > accEncode(Data, []). > > accEncode([], []) -> > [255, 0, 0, 1]; > > accEncode([], EncodedData) -> > Length = length(EncodedData), > Length1 = Length div 256, > Length2 = Length rem 256, > [255, Length1, Length2, 1 | EncodedData]; > > accEncode([{ServiceType, QueueTime}|RestData], EncodedData) -> > accEncode(RestData, [ServiceType div 256, ServiceType rem 256, QueueTime div 256, QueueTime rem 256 | EncodedData]). > > > send(Socket, Data)-> > io:format("accsocket:send(~p,~p)~n",[Socket,Data]), > erlang:ports(), > case gen_tcp:send(Socket, Data) of > % Socket ! {self(), Data}. > ok -> > io:format("accsock:send-> ok~n"), > ok; > > {error, Reason} -> > s io:format("accsock:error Reasson ~p~n",[Reason]), > erlang:ports(), > exit(Reason) > end. > > > > ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From thierry@REDACTED Tue Feb 4 13:46:02 2003 From: thierry@REDACTED (Thierry Mallard) Date: Tue, 04 Feb 2003 13:46:02 +0100 (MET) Subject: Erlang projects association In-Reply-To: <5F03ACA2F76DD411B8BC00508BE3B4D71200F73A@esemont203.gbg.edt.ericsson.se> References: <5F03ACA2F76DD411B8BC00508BE3B4D71200F73A@esemont203.gbg.edt.ericsson.se> Message-ID: <1044362762.3e3fb60aeeb64@imp.pro.proxad.net> Quoting "Vlad Dumitrescu (EAW)" : > > I hope the infrastructure we are going to set up is going to have the > > same effect on Erlang development. > > And please do not read the following as buzzwords, but as > > something that > > I feel: The association is not intended to have a central and > > unique way > > to see the Erlang world, but as a facilitator to make things happens. > > I think it is a good idea. Just one question, for now: why not use > www.erlang.org? Does Ericsson own the domain and the site? Erlang.org is a reference website dedicated the language itself. Our purpose is to be something like a "Erlang dedicated sourceforge", among other things. In the end, we may very well imagine a fusion of those two websites, but to start quickly, we'd prefer to work on a separate one. > It might be a little confusing with both erlang.org and > erlang-projects.org... As long as we clearly state what erlang.org and erlang-projects.org should do, and if we provide the links between thoses sites, then it should be clear enought... hopefully ! ;-) erlang.org : the language itself (documentation, downloads, ...) erlang-projects.org : task groups and projects using Erlang Thanks for your feedback :) -- Thierry Mallard http://vawis.net From hal@REDACTED Tue Feb 4 14:17:06 2003 From: hal@REDACTED (Hal Snyder) Date: Tue, 04 Feb 2003 07:17:06 -0600 Subject: Publicity In-Reply-To: (Joe Armstrong's message of "Tue, 4 Feb 2003 10:09:19 +0100 (CET)") References: Message-ID: <87isw0nq25.fsf@ghidra.vail> Joe Armstrong writes: > Just a quick thought. > > I have for a long time thought that this mailing list should have a > more public face - are there any opinion for or against a move to a > usenet group or something else, for example a yahoo group etc. We are already out there on gmane (wave to the camera): http://news.gmane.org/thread.php?group=gmane.comp.lang.erlang.general From D.WILLIAMS@REDACTED Tue Feb 4 15:06:48 2003 From: D.WILLIAMS@REDACTED (WILLIAMS Dominic) Date: Tue, 4 Feb 2003 15:06:48 +0100 Subject: Reliability of communication Message-ID: A question related to the development of safety-critical systems: Is inter-process and inter-node communication in Erlang only as reliable as TCP/IP, or are any additional error-detecting strategies used (e.g. hamming, cyclic or polynomial codes)? Dominic. From per@REDACTED Tue Feb 4 18:22:46 2003 From: per@REDACTED (Per Bergqvist) Date: Tue, 04 Feb 2003 18:22:46 +0100 Subject: Reliability of communication In-Reply-To: Message-ID: <200302041722.h14HMkr04216@hunden.levonline.com> The weakest part in distributed erlang is IMHO that is relies on TCP and the implementation of TCP is most (all major) operating systems. No problem when communicating within a single host but for inter-host comms you will see severe problems as soon as you start to pull cables. In order to build a real high availability system you need to make sure you have a high availability TCP solution either via fault tolerant hardware switches or software solutions supporting high availability on simple redundant switching hardware (i.e. what I presented on EUC 2001). The latter is at least as good as the hardware solutions around and is one or two orders of magnitude cheaper. The obviously best solution would be to use SCTP for inter-host communication. As soon as the lksctp guys get stable I plan to dig in to it. /Per > A question related to the development of safety-critical systems: > > Is inter-process and inter-node communication in Erlang only as reliable as TCP/IP, or are any additional error-detecting strategies used (e.g. hamming, cyclic or polynomial codes)? > > Dominic. > ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From erlang@REDACTED Tue Feb 4 18:53:54 2003 From: erlang@REDACTED (Peter-Henry Mander) Date: Tue, 04 Feb 2003 17:53:54 +0000 Subject: Megaco woes with ServiceChangeReason = ReasonToken EQUAL VALUE Message-ID: <3E3FFE32.4050100@manderp.freeserve.co.uk> Good evening Erlang Megaco gurus, I have a question concerning the interpretation of the serviceChangeReason ABNF description (versions one and two *), which quotes (**): ; A serviceChangeReason consists of a numeric reason code ; and an optional text description. ; A serviceChangeReason MUST be encoded using the quotedString ; form of VALUE. ; The quotedString SHALL contain a decimal reason code, ; optionally followed by a single space character and a ; textual description string. serviceChangeReason = ReasonToken EQUAL VALUE ... and a little further down we have (***): VALUE = quotedString / 1*(SafeChar) The Erlang Megaco implementation follows the VALUE spec, not the quotedString requirement as described in the comment. i.e. MEGACO/1 [10.1.0.200]:2944 Transaction = 1 { Context = - { ServiceChange = root { Services { Method = Restart, Version = 2, Reason = 901 <------- 1*(SafeChar) } } } } -OR- MEGACO/1 [10.1.0.200]:2944 Transaction = 1 { Context = - { ServiceChange = root { Services { Method = Restart, Version = 2, Reason = "901 Cold Boot" <------- quotedString } } } } But if the comments are followed to the letter (and I understood correctly) the Reason should be quoted every time, thus: MEGACO/1 [10.1.0.200]:2944 Transaction = 1 { Context = - { ServiceChange = root { Services { Method = Restart, Version = 2, Reason = "901" <------- quotedString even when 1*(SafeChar) matches. } } } } Erlang Megaco is technically correct if the ABNF is stripped of comments (which is what happens when building the Erlang Megaco stack from the spec, the ABNF/ASN.1 compiler won't read comments, or am I underestimating Erlang? :-). It looks as if those knowledgable fellows of the IETF should have specified: serviceChangeReason = ReasonToken EQUAL quotedString (instead of VALUE) Am I correct? How do I force Erlang Megaco to _always_ send quotedString, not just when there are unSafeChars in the string? Is it strictly necessary to enforce quotedString? Help! Pete. * Versions 1.03 as in draft-ietf-megaco-3015corr-03.txt and 2.03 as in draft-ietf-megaco-h248v2-03.txt ** line 6557 in v1.03 and line 7275 in v2.03 *** line 6623 in v1.03 and 7531in v2.03 From daniel.dudley@REDACTED Tue Feb 4 19:38:19 2003 From: daniel.dudley@REDACTED (Daniel Dudley) Date: Tue, 4 Feb 2003 19:38:19 +0100 Subject: Embedded Erlang Message-ID: <000701c2cc7c$96f20690$85d1b33e@dld2000> Is the following message mildly interesting to anyone on this list? Any takers? ;-) Daniel Alan Littleford wrote in message (4. februar 2003 18:37) to comp.lang.functional: Subject; Embedded Erlang I'm looking for a language which lends itself naturally to a highly distributed environment (lots of little networked devices running uclinux and about 8-meg of ram, no mmu, of which I'd probably get 1-2 meg). Erlang looks ideal from a language point-of-view but I haven't been able to pin down the embedding issues: What is the smallest (practical) amount of RAM required for Erlang + Apps? Is there a rule-of-thumb (xK for run-time + ~yK per K of erl source) ? Are there guideliness/howto etc for stripping Erlang down -- anyone done it ?? Thanks Alan (Erlang newbie) From matthias@REDACTED Tue Feb 4 22:54:16 2003 From: matthias@REDACTED (Matthias Lang) Date: Tue, 4 Feb 2003 22:54:16 +0100 Subject: Embedded Erlang In-Reply-To: <000701c2cc7c$96f20690$85d1b33e@dld2000> References: <000701c2cc7c$96f20690$85d1b33e@dld2000> Message-ID: <15936.13960.304966.571843@antilipe.corelatus.se> Alan writes: > I'm looking for a language which lends itself naturally to a highly > distributed environment (lots of little networked devices running > uclinux and about 8-meg of ram, no mmu, of which I'd probably get 1-2 > meg). Erlang looks ideal from a language point-of-view but I haven't > been able to pin down the embedding issues: > What is the smallest (practical) amount of RAM required for Erlang + > Apps? Is there a rule-of-thumb (xK for run-time + ~yK per K of erl > source) ? Are there guideliness/howto etc for stripping Erlang down > -- anyone done it ?? I run Erlang on an embedded telecomms system. Just starting the Erlang R8B VM to get a prompt eats 3.5M (RSS). A typical system in steady-state operation (as a telephone switch) uses about 7M (RSS). Cutting that down to 2M sounds "too hard". The smallest system I've seen running Erlang had 16M of RAM. The guys who created the VM may have some better ideas. Squeezing disk/flash storage is easier. You can fit a fairly complete system into 2M without special tricks. If you start throwing out useful libraries and compressing things you can get as low as 0.5M: http://www.bluetail.com/~joe/sae_r7b/sae.html A completely different approach would be to use an Erlang implementation other than Ericsson's. I know nothing about such systems and I don't know of any of them being used in production systems, but it may be worth a quick look: http://goanna.cs.rmit.edu.au/~geoff/erlang/ http://www.iro.umontreal.ca/~etos/ Matthias From shrogers@REDACTED Wed Feb 5 02:49:02 2003 From: shrogers@REDACTED (steve@shrogers.com) Date: Tue, 4 Feb 2003 19:49:02 -0600 (GMT) Subject: non-telecom in erlang Message-ID: <6267321.1044406354215.JavaMail.nobody@wamui03.slb.atl.earthlink.net> Can you tell us what kind of transaction time constraints apply to your banking project? Regards, Steve From bernardp@REDACTED Wed Feb 5 04:20:40 2003 From: bernardp@REDACTED (Pierpaolo BERNARDI) Date: Wed, 5 Feb 2003 04:20:40 +0100 Subject: Unused functions. Message-ID: <031001c2ccc5$a6736840$84f06850@c1p4e3> Hello, is there a way to tell the compiler not to evict apparently unused functions? I have a bunch of functions that are called only via apply. The compiler warns that these functions are unused and removes them. Now, this is not a serious problem: adding a -compile(export_all) solves it, but maybe there's a cleaner way? Cheers Pierpaolo From matthias@REDACTED Wed Feb 5 07:57:37 2003 From: matthias@REDACTED (Matthias Lang) Date: Wed, 5 Feb 2003 07:57:37 +0100 Subject: Unused functions. In-Reply-To: <031001c2ccc5$a6736840$84f06850@c1p4e3> References: <031001c2ccc5$a6736840$84f06850@c1p4e3> Message-ID: <15936.46561.127813.596779@antilipe.corelatus.se> Pierpaolo BERNARDI writes: > is there a way to tell the compiler not to evict apparently > unused functions? > > I have a bunch of functions that are called only via apply. > The compiler warns that these functions are unused and > removes them. Apply can only call exported functions. The compiler is doing the right thing. It is removing functions which you cannot possibly call. See also the manual entry about 'apply': http://www.erlang.org/doc/r9b/lib/kernel-2.8.0/doc/html/erlang.html Matthias From micael.karlberg@REDACTED Wed Feb 5 08:02:05 2003 From: micael.karlberg@REDACTED (Micael Karlberg) Date: Wed, 5 Feb 2003 08:02:05 +0100 Subject: Megaco woes with ServiceChangeReason = ReasonToken EQUAL VALUE In-Reply-To: <3E3FFE32.4050100@manderp.freeserve.co.uk> References: <3E3FFE32.4050100@manderp.freeserve.co.uk> Message-ID: <15936.46829.884359.832344@gargle.gargle.HOWL> Hi, I would like to see your erlang message, because when I try, it works just fine. Here's an example: Erlang megaco (service change) message {'MegacoMessage',asn1_NOVALUE, {'Message',1, {ip4Address,{'IP4Address',"|||?",asn1_NOVALUE}}, {transactions, [{transactionRequest, {'TransactionRequest', 9998, [{'ActionRequest', 0, asn1_NOVALUE, asn1_NOVALUE, [{'CommandRequest', {serviceChangeReq, {'ServiceChangeRequest', [{megaco_term_id, false, ["root"]}], {'ServiceChangeParm', restart, {portNumber, 55555}, asn1_NOVALUE, {'ServiceChangeProfile', "resgw", 1}, ["901 mg col boot"], asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE}}}, asn1_NOVALUE, asn1_NOVALUE}]}]}}]}}} And this is what it looks like pretty-encoded: MEGACO/1 [124.124.124.222] Transaction = 9998 { Context = - { ServiceChange = root { Services { Method = Restart, ServiceChangeAddress = 55555, Profile = resgw/1, Reason = "901 mg col boot" } } } } And this is what it looks like compact-encoded: !/1 [124.124.124.222] T=9998{C=-{SC=root{SV{MT=RS,AD=55555,PF=resgw/1,RE="901 mg col boot"}}}} Regards, /BMK Peter-Henry Mander writes: > Good evening Erlang Megaco gurus, > > I have a question concerning the interpretation of the > serviceChangeReason ABNF description (versions one and two *), which > quotes (**): > > ; A serviceChangeReason consists of a numeric reason code > ; and an optional text description. > ; A serviceChangeReason MUST be encoded using the quotedString > ; form of VALUE. > ; The quotedString SHALL contain a decimal reason code, > ; optionally followed by a single space character and a > ; textual description string. > > serviceChangeReason = ReasonToken EQUAL VALUE > > ... and a little further down we have (***): > > VALUE = quotedString / 1*(SafeChar) > > The Erlang Megaco implementation follows the VALUE spec, not the > quotedString requirement as described in the comment. i.e. > > MEGACO/1 [10.1.0.200]:2944 > Transaction = 1 { > Context = - { > ServiceChange = root { > Services { > Method = Restart, > Version = 2, > Reason = 901 <------- 1*(SafeChar) > } > } > } > } > > -OR- > > MEGACO/1 [10.1.0.200]:2944 > Transaction = 1 { > Context = - { > ServiceChange = root { > Services { > Method = Restart, > Version = 2, > Reason = "901 Cold Boot" <------- quotedString > } > } > } > } > > But if the comments are followed to the letter (and I understood > correctly) the Reason should be quoted every time, thus: > > MEGACO/1 [10.1.0.200]:2944 > Transaction = 1 { > Context = - { > ServiceChange = root { > Services { > Method = Restart, > Version = 2, > Reason = "901" <------- quotedString even when > 1*(SafeChar) matches. > } > } > } > } > > Erlang Megaco is technically correct if the ABNF is stripped of comments > (which is what happens when building the Erlang Megaco stack from the > spec, the ABNF/ASN.1 compiler won't read comments, or am I > underestimating Erlang? :-). It looks as if those knowledgable fellows > of the IETF should have specified: > > serviceChangeReason = ReasonToken EQUAL quotedString (instead of VALUE) > > Am I correct? How do I force Erlang Megaco to _always_ send > quotedString, not just when there are unSafeChars in the string? Is it > strictly necessary to enforce quotedString? > > Help! > > Pete. > > * Versions 1.03 as in draft-ietf-megaco-3015corr-03.txt and 2.03 as in > draft-ietf-megaco-h248v2-03.txt > > ** line 6557 in v1.03 and line 7275 in v2.03 > > *** line 6623 in v1.03 and 7531in v2.03 > -- Micael Karlberg Ericsson AB, ?lvsj? Sweden Tel: +46 8 727 5668 EAB/UHK/KD - OTP Product Development ECN: 851 5668 Mail: micael.karlberg@REDACTED Fax: +46 8 727 5775 From bjarne.dacker@REDACTED Wed Feb 5 00:42:11 2003 From: bjarne.dacker@REDACTED (=?iso-8859-1?Q?Bjarne_Olov_D=E4cker?=) Date: Wed, 05 Feb 2003 00:42:11 +0100 Subject: Erlang projects association References: <20030203135121.GA21096@mremond.cgey.capgemini.fr> Message-ID: <011401c2cca7$0a608e60$012069d4@segeltorp> Hello Could we not get some support from ITEA ? http://www.itea-office.org/ Erlang (and OTP) should be one of the most promising starting points for developing IT technology. Bjarne ----- Original Message ----- From: "Mickael Remond" To: Sent: Monday, February 03, 2003 2:51 PM Subject: Erlang projects association Hello, Two years ago, we made the Erlang-fr.org website. Its mission was to promote Erlang in France. We now realize that two things were wrong: - We should not have limited this initiative to France. - We did not pay enough attention to the fact that promoting Erlang is currently a very difficult task without a proper understanding of the real expectations of both the users and the developers. For the latter, the recent activity on this mailing list seems to indicate that we are not alone ;-) That's why we have decided to create an association to pragmatically work on those issues. The main goal of this association is to gather users and developers, both individuals and companies to work on projects that are needed to help us spread Erlang. The first tasks will be to identify the major domains for which Erlang should shine. We will then start dedicated workgroups that will have to identify existing relevant projects and to help them go further. We are aware that this quick announcement seems quite abstract at the moment but hopefully it will soon get "real" :-) Stay tuned ! ;-) -- Thierry Mallard Micka?l R?mond http://www.erlang-fr.org/ From jay@REDACTED Wed Feb 5 07:47:13 2003 From: jay@REDACTED (Jay Nelson) Date: Tue, 04 Feb 2003 22:47:13 -0800 Subject: Embedded Erlang Message-ID: <4.2.2.20030204224434.00ce2c30@duomark.com> > I'm looking for a language which lends itself naturally to a highly > distributed environment (lots of little networked devices running > uclinux and about 8-meg of ram, no mmu, of which I'd probably get 1-2 > meg). While on the subject, I've wondered if erlang runs on uclinux. My understanding is the lack of mmu means uclinux replaces the vfork call with a blocking fork (or something like that). Has anyone run erlang under uclinux? Does it still exhibit similar process creation / communication performance? jay From francesco@REDACTED Wed Feb 5 09:46:45 2003 From: francesco@REDACTED (Francesco Cesarini) Date: Wed, 05 Feb 2003 08:46:45 +0000 Subject: Unused functions. References: <031001c2ccc5$a6736840$84f06850@c1p4e3> Message-ID: <3E40CF75.4070801@erlang-consulting.com> If you call your functions using apply, you have to export then anyhow. Not exporting them will give you a run time error. Saluti, Francesco -- http://www.erlang-consulting.com Pierpaolo BERNARDI wrote: > Hello, > > is there a way to tell the compiler not to evict apparently > unused functions? > > I have a bunch of functions that are called only via apply. > The compiler warns that these functions are unused and > removes them. > > Now, this is not a serious problem: adding a -compile(export_all) > solves it, but maybe there's a cleaner way? > > Cheers > Pierpaolo > > > > From erlang@REDACTED Wed Feb 5 09:45:54 2003 From: erlang@REDACTED (Peter-Henry Mander) Date: Wed, 05 Feb 2003 08:45:54 +0000 Subject: Megaco woes with ServiceChangeReason = ReasonToken EQUAL VALUE References: <3E3FFE32.4050100@manderp.freeserve.co.uk> <15936.46829.884359.832344@gargle.gargle.HOWL> Message-ID: <3E40CF42.7030709@manderp.freeserve.co.uk> Hi Micael, Yes, this is what I expect too. Allow me to elaborate. Below is the function I use to issue the service change, with a small modification to match the Reason field in your example: service_change(ConnHandle, Method, Reason) -> megaco:call( ConnHandle, [#'ActionRequest'{ contextId = ?megaco_null_context_id, commandRequests = [ #'CommandRequest'{ command = { serviceChangeReq, #'ServiceChangeRequest'{ terminationID = [?megaco_root_termination_id], serviceChangeParms = #'ServiceChangeParm'{ serviceChangeMethod = Method, serviceChangeReason = ["901 mg cold boot"], %%% mod here serviceChangeVersion = 2 }}}}]}], [] ). This produces the following message. The serviceChangeReason field format has quotes, similar to your example: MEGACO/1 [10.1.0.200]:2944 Transaction = 1 { Context = - { ServiceChange = root { Services { Method = Restart, Version = 2, Reason = "901 mg cold boot" } } } } But if I modify the serviceChangeReason to be a safeChar string, containing digits only, thus: service_change(ConnHandle, Method, Reason) -> megaco:call( ConnHandle, [#'ActionRequest'{ contextId = ?megaco_null_context_id, commandRequests = [ #'CommandRequest'{ command = { serviceChangeReq, #'ServiceChangeRequest'{ terminationID = [?megaco_root_termination_id], serviceChangeParms = #'ServiceChangeParm'{ serviceChangeMethod = Method, serviceChangeReason = ["901"], %% using safeChar serviceChangeVersion = 2 }}}}]}], [] ). I get the following result where 901 appears without quotes: MEGACO/1 [10.1.0.200]:2944 Transaction = 1 { Context = - { ServiceChange = root { Services { Method = Restart, Version = 2, Reason = 901 } } } } So I conjecture that if you change line 32 from ["901 mg col boot"] to ["901"] you too will have a similar result. I think that the comment in the ABNF suggests that even a safeChar string should be formatted with quotes. I humbly believe that the comment about serviceChangeReason should have been rewritten as a rule in the IETF's ABNF file to avoid ambiguity, and that Note 1 in Annex B.2 has allowed the IETF to be less than rigourous with their own ABNF code. Pete. P.s. I modified line 9 in your listing 'cos Mozilla didn't like copying the binary string in ip4Address. Micael Karlberg wrote: 1 Hi, 2 3 I would like to see your erlang message, because when I try, 4 it works just fine. Here's an example: 5 6 Erlang megaco (service change) message 7 {'MegacoMessage',asn1_NOVALUE, 8 {'Message',1, 9 {ip4Address,{'IP4Address',"********",asn1_NOVALUE}}, 10 {transactions, 11 [{transactionRequest, 12 {'TransactionRequest', 13 9998, 14 [{'ActionRequest', 15 0, 16 asn1_NOVALUE, 17 asn1_NOVALUE, 18 [{'CommandRequest', 19 {serviceChangeReq, 20 {'ServiceChangeRequest', 21 [{megaco_term_id, 22 false, 23 ["root"]}], 24 {'ServiceChangeParm', 25 restart, 26 {portNumber, 27 55555}, 28 asn1_NOVALUE, 29 {'ServiceChangeProfile', 30 "resgw", 31 1}, 32 ["901 mg col boot"], 33 asn1_NOVALUE, 34 asn1_NOVALUE, 35 asn1_NOVALUE, 36 asn1_NOVALUE}}}, 37 asn1_NOVALUE, 38 asn1_NOVALUE}]}]}}]}}} 39 40 And this is what it looks like pretty-encoded: 41 42 MEGACO/1 [124.124.124.222] 43 Transaction = 9998 { 44 Context = - { 45 ServiceChange = root { 46 Services { 47 Method = Restart, 48 ServiceChangeAddress = 55555, 49 Profile = resgw/1, 50 Reason = "901 mg col boot" 51 } 52 } 53 } 54 } 55 56 And this is what it looks like compact-encoded: 57 58 !/1 [124.124.124.222] 59 T=9998{C=-{SC=root{SV{MT=RS,AD=55555,PF=resgw/1,RE="901 mg col boot"}}}} 60 61 62 Regards, 63 /BMK 64 65 Peter-Henry Mander writes: 66 > Good evening Erlang Megaco gurus, 67 > 68 > I have a question concerning the interpretation of the 69 > serviceChangeReason ABNF description (versions one and two *), which 70 > quotes (**): 71 > 72 > ; A serviceChangeReason consists of a numeric reason code 73 > ; and an optional text description. 74 > ; A serviceChangeReason MUST be encoded using the quotedString 75 > ; form of VALUE. 76 > ; The quotedString SHALL contain a decimal reason code, 77 > ; optionally followed by a single space character and a 78 > ; textual description string. 79 > 80 > serviceChangeReason = ReasonToken EQUAL VALUE 81 > 82 > ... and a little further down we have (***): 83 > 84 > VALUE = quotedString / 1*(SafeChar) 85 > 86 > The Erlang Megaco implementation follows the VALUE spec, not the 87 > quotedString requirement as described in the comment. i.e. 88 > 89 > MEGACO/1 [10.1.0.200]:2944 90 > Transaction = 1 { 91 > Context = - { 92 > ServiceChange = root { 93 > Services { 94 > Method = Restart, 95 > Version = 2, 96 > Reason = 901 <------- 1*(SafeChar) 97 > } 98 > } 99 > } 100 > } 101 > 102 > -OR- 103 > 104 > MEGACO/1 [10.1.0.200]:2944 105 > Transaction = 1 { 106 > Context = - { 107 > ServiceChange = root { 108 > Services { 109 > Method = Restart, 110 > Version = 2, 111 > Reason = "901 Cold Boot" <------- quotedString 112 > } 113 > } 114 > } 115 > } 116 > 117 > But if the comments are followed to the letter (and I understood 118 > correctly) the Reason should be quoted every time, thus: 119 > 120 > MEGACO/1 [10.1.0.200]:2944 121 > Transaction = 1 { 122 > Context = - { 123 > ServiceChange = root { 124 > Services { 125 > Method = Restart, 126 > Version = 2, 127 > Reason = "901" <------- quotedString even when 128 > 1*(SafeChar) matches. 129 > } 130 > } 131 > } 132 > } 133 > 134 > Erlang Megaco is technically correct if the ABNF is stripped of comments 135 > (which is what happens when building the Erlang Megaco stack from the 136 > spec, the ABNF/ASN.1 compiler won't read comments, or am I 137 > underestimating Erlang? :-). It looks as if those knowledgable fellows 138 > of the IETF should have specified: 139 > 140 > serviceChangeReason = ReasonToken EQUAL quotedString (instead of VALUE) 141 > 142 > Am I correct? How do I force Erlang Megaco to _always_ send 143 > quotedString, not just when there are unSafeChars in the string? Is it 144 > strictly necessary to enforce quotedString? 145 > 146 > Help! 147 > 148 > Pete. 149 > 150 > * Versions 1.03 as in draft-ietf-megaco-3015corr-03.txt and 2.03 as in 151 > draft-ietf-megaco-h248v2-03.txt 152 > 153 > ** line 6557 in v1.03 and line 7275 in v2.03 154 > 155 > *** line 6623 in v1.03 and 7531in v2.03 156 > From farzin_b23@REDACTED Wed Feb 5 10:14:17 2003 From: farzin_b23@REDACTED (Farzin_B23 SOORI) Date: Wed, 05 Feb 2003 09:14:17 +0000 Subject: How to build a distributed network of erlang nodes? Message-ID: Dear workmates; I have started programming with erlang just right two dayes ago.I want to build a distributed networked system of erlang nodes. Please tell me how to do the following items: -host naming -node naming -connection estabilishment between remote nodes -testing message passing between two remote nodes -can you introduce some useful resources with some case examples relating to above items? Sincerely Bastani _________________________________________________________________ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail From sureshsaragadam@REDACTED Wed Feb 5 11:09:32 2003 From: sureshsaragadam@REDACTED (=?iso-8859-1?q?Suresh=20S?=) Date: Wed, 5 Feb 2003 10:09:32 +0000 (GMT) Subject: recommand any tool for testing and tracing of any app or a module in erlang Message-ID: <20030205100932.39452.qmail@web8202.mail.in.yahoo.com> Hi , Is there any best recommended tool for testing an erlang application, or any erlang module. Thanking u for ur time suresh s ________________________________________________________________________ Missed your favourite TV serial last night? Try the new, Yahoo! TV. visit http://in.tv.yahoo.com From goran.bage@REDACTED Wed Feb 5 11:42:29 2003 From: goran.bage@REDACTED (Goran Bage) Date: Wed, 05 Feb 2003 11:42:29 +0100 Subject: warn_unused_vars In-Reply-To: <20030201134152.A5768@bluetail.com> References: <001701c2c98c$e7bfdb30$0100a8c0@LISA> <20030201134152.A5768@bluetail.com> Message-ID: <3E40EA95.10505@mobilearts.se> Klacke wrote: > On Sat, Feb 01, 2003 at 01:57:33AM +0100, Happi wrote: > >>I think Richard C. or Bj?rn G. can explain this better... >>... but I'll give it a try, and they can fill in the blanks >>and correct my errors. >> >> >>The problem comes from the order in which things are done >>in the compiler. >> >>The compile options in the file are not parsed until >>after the linter is executed -- hence the linter >>will not see the warn_unused_vars flag. >> >>To get around this problem I have set >>ERL_COMPILER_OPTIONS >>to >>'[warn_unused_vars,nowarn_shadow_vars]' >>in my unix-shell. > > > > Excellent, I've had problems with this as well but > never had the energy to investigate. > > Furthermore, I warmly recommend the readers of this > list to start using these warn messages from the compiler. > It has saved me lots of boring debugging work. > Hmm, just tried it but there is something fishy with list comprehensions, the following will give a warning that App is unused. get_creds(Users, App) -> [ get_cred(User, App) || User <- Users ]. -- -- Goran ------------------------- May the Snow be with you ---- Goran Bage, MobileArts, www.mobilearts.se Tj?rhovsgatan 56, SE-102 67 Stockholm, Sweden email:goran.bage@REDACTED, phone: +46 733 358405 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3443 bytes Desc: S/MIME Cryptographic Signature URL: From francesco@REDACTED Wed Feb 5 12:17:15 2003 From: francesco@REDACTED (Francesco Cesarini) Date: Wed, 05 Feb 2003 11:17:15 +0000 Subject: recommand any tool for testing and tracing of any app or a module in erlang References: <20030205100932.39452.qmail@web8202.mail.in.yahoo.com> Message-ID: <3E40F2BB.2000402@erlang-consulting.com> Check out dbg, as it encapsulates the functinaliity of the trace and trace_pattern bifs in a somewhat user friendly text based tool. It will allow you to trace local and global function calls, message passing, manipulate data, monitor memory consumption, and much much more. Graphic tools include appmon, to monitor applications, pman to monitor concurrency, and the debugger, to follow sequential code. Other tools include eprof, coast (or cover, it changes name every other release), and seq_trace. Browse through the manual pages. You will find everything you need. Regards, Francesco -- http://www.erlang-consulting.com Suresh S wrote: > Hi , > > Is there any best recommended tool for testing an > erlang application, or any erlang module. > > Thanking u for ur time > > suresh s > > > > ________________________________________________________________________ > Missed your favourite TV serial last night? Try the new, Yahoo! TV. > visit http://in.tv.yahoo.com > > > From eleberg@REDACTED Wed Feb 5 12:42:37 2003 From: eleberg@REDACTED (Bengt Kleberg) Date: Wed, 5 Feb 2003 12:42:37 +0100 (MET) Subject: Unused functions. Message-ID: <200302051142.h15BgbH26444@cbe.ericsson.se> > From: "Pierpaolo BERNARDI" > To: > Subject: Unused functions. > Date: Wed, 5 Feb 2003 04:20:40 +0100 ...deleted > I have a bunch of functions that are called only via apply. > The compiler warns that these functions are unused and > removes them. there is a suggestion from richardc@REDACTED to not use apply at all. see his new erlang standard library packages. for those that do not have them i will quoute from the CONVENTIONS file: - Don't use apply(Module, Function, Arguments) unless the Arguments list actually *can* vary arbitrarily in length. (This is rarely the case.) Instead, use: Module:Function(Arg1, ... ArgN) Where Module and/or Function is a variable. (This is *much* more efficient than 'apply'.) If Arguments can have one of a limited number of lengths, then write an explicit switch: case Arguments of [] -> Module:Function(); [A1] -> Module:Function(A1); [A1, A2] -> Module:Function(A1,A2) end (This is still more efficient, and also has the advantage that it catches illegal-length argument lists.) Never use erlang:apply/2. (If you did not know it existed, then just forget about it again.) bengt From D.WILLIAMS@REDACTED Wed Feb 5 12:55:13 2003 From: D.WILLIAMS@REDACTED (WILLIAMS Dominic) Date: Wed, 5 Feb 2003 12:55:13 +0100 Subject: non-telecom in erlang Message-ID: > From: DANIESC SCHUTTE [mailto:DANIESC.SCHUTTE@REDACTED] > > - what improvements did you observe compared to previous, > non-Erlang, projects? > > We used an extreme programming methodology - and we saw a > rapid time to market. > Thanks for all the details you provided on your banking project - very interesting. I was particularly interested about the methodology you used, because we have been extreme programming for 3 years now, and I was wondering how well the approach would work with Erlang. What tools do you use for unit tests and acceptance tests? What does it feel like to do refactoring in Erlang? Dominic. From etxuwig@REDACTED Wed Feb 5 13:14:20 2003 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 5 Feb 2003 13:14:20 +0100 (MET) Subject: Reliability of communication In-Reply-To: <200302041722.h14HMkr04216@hunden.levonline.com> Message-ID: It should perhaps be mentioned that distributed erlang is designed in such a way that you could implement your own carrier, e.g. SSL, SCTP, SCI, SAAL, MTP/VIA, or other. See the chapter on "How to implement an alternative carrier for the erlang distribution" in the OTP documentation: http://www.erlang.org/doc/r9b/erts-5.2/doc/html/alt_dist.html#3 The document contains an example that implements distributed erlang over UNIX Domain Sockets. Of course, to attempt this, you really should know what you're doing. (: Regarding error-detecting strategies, there is a periodic tick which attempts to detect hanging nodes and communication failures (one can set the frequency with the '-kernel net_ticktime' command line option). It's not advisable to set net_ticktime to less than 10 on a normal UNIX system, in my opinion. /Uffe On Tue, 4 Feb 2003, Per Bergqvist wrote: >The weakest part in distributed erlang is IMHO that is >relies on TCP and the implementation of TCP is most (all >major) operating systems. > >No problem when communicating within a single host but for >inter-host comms you will see severe problems as soon as >you start to pull cables. > >In order to build a real high availability system you need >to make sure you have a high availability TCP solution >either via fault tolerant hardware switches or software >solutions supporting high availability on simple redundant >switching hardware (i.e. what I presented on EUC 2001). The >latter is at least as good as the hardware solutions around >and is one or two orders of magnitude cheaper. > >The obviously best solution would be to use SCTP for >inter-host communication. As soon as the lksctp guys get >stable I plan to dig in to it. > >/Per > >> A question related to the development of safety-critical systems: >> >> Is inter-process and inter-node communication in Erlang >> only as reliable as TCP/IP, or are any additional >> error-detecting strategies used (e.g. hamming, cyclic or >> polynomial codes)? >> >> Dominic. >> >========================================================= >Per Bergqvist >Synapse Systems AB >Phone: +46 709 686 685 >Email: per@REDACTED > -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson Telecom AB, ATM Multiservice Networks From D.WILLIAMS@REDACTED Wed Feb 5 13:24:44 2003 From: D.WILLIAMS@REDACTED (WILLIAMS Dominic) Date: Wed, 5 Feb 2003 13:24:44 +0100 Subject: Reliability of communication Message-ID: Thanks for various interesting answers about detecting disconnection. I am interested in that too. My initial question was about detecting random transmission errors in the payload (using checksums or by encoding the data...). I assume that Erlang just relies on the TCP and IP layer checksums? From enano@REDACTED Wed Feb 5 13:53:18 2003 From: enano@REDACTED (Miguel Barreiro Paz) Date: Wed, 5 Feb 2003 13:53:18 +0100 (CET) Subject: Reliability of communication In-Reply-To: References: Message-ID: > My initial question was about detecting random transmission errors in > the payload (using checksums or by encoding the data...). I assume that > Erlang just relies on the TCP and IP layer checksums? If you can't trust your TCP stack, you have bigger problems than that - your network-mounted filesystems (over SMB (TCP), NFS (TCP) or even worse, NFS over UDP, go figure!) may be corrupted, so maybe you are not even compiling the right source. Worse, your HTTP (TCP) or FTP (TCP) download of Erlang and OTP might be corrupted! Even, your SMTP (TCP) mail feed might be garbled! Maybe neither of us wrote this?!? Joke apart: the odds of both the TCP CRC16 and the Ethernet CRC32 (or whatever link-level layer) ending up correct with wrong data are *really* small. Regards, Miguel From Marc.Vanwoerkom@REDACTED Wed Feb 5 14:07:11 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Wed, 5 Feb 2003 14:07:11 +0100 (MET) Subject: Recent download statistics? Message-ID: <200302051307.h15D7BY01269@bonsai.fernuni-hagen.de> The latest download statistics I was able to spot on www.erlang.org seems to be a year old. Is there a more recent one available? Regards, Marc From etxuwig@REDACTED Wed Feb 5 14:09:14 2003 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 5 Feb 2003 14:09:14 +0100 (MET) Subject: recommand any tool for testing and tracing of any app or a module in erlang In-Reply-To: <20030205100932.39452.qmail@web8202.mail.in.yahoo.com> Message-ID: On Wed, 5 Feb 2003, Suresh S wrote: >Hi , > >Is there any best recommended tool for testing an >erlang application, or any erlang module. Take a look at the Erlang/OTP test server: http://www.erlang.org/project/test_server/index.html It's the tool used by both AXD 301 and the Erlang/OTP team. /Uffe -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson Telecom AB, ATM Multiservice Networks From micke@REDACTED Wed Feb 5 14:31:55 2003 From: micke@REDACTED (micke) Date: Wed, 5 Feb 2003 14:31:55 +0100 Subject: Recent download statistics? Message-ID: <3E416FD7@epostleser.online.no> Interesting question seen from the perspective: Where is erlang used? - the opensource version? - the licenced versions? >===== Original Message From Marc Ernst Eddy van Woerkom ===== >The latest download statistics I was able to spot on www.erlang.org >seems to be a year old. > >Is there a more recent one available? > >Regards, >Marc From micael.karlberg@REDACTED Wed Feb 5 14:46:48 2003 From: micael.karlberg@REDACTED (Micael Karlberg) Date: Wed, 5 Feb 2003 14:46:48 +0100 Subject: recommand any tool for testing and tracing of any app or a module in erlang In-Reply-To: <3E40F2BB.2000402@erlang-consulting.com> References: <20030205100932.39452.qmail@web8202.mail.in.yahoo.com> <3E40F2BB.2000402@erlang-consulting.com> Message-ID: <15937.5576.659747.310331@gargle.gargle.HOWL> Another (graphic) tool is et, Event Trace, implemented using dbg. The Megaco application uses et. /BMK Francesco Cesarini writes: > Check out dbg, as it encapsulates the functinaliity of the trace and > trace_pattern bifs in a somewhat user friendly text based tool. It will > allow you to trace local and global function calls, message passing, > manipulate data, monitor memory consumption, and much much more. > > Graphic tools include appmon, to monitor applications, pman to monitor > concurrency, and the debugger, to follow sequential code. > > Other tools include eprof, coast (or cover, it changes name every other > release), and seq_trace. > > Browse through the manual pages. You will find everything you need. > > Regards, > Francesco > -- > http://www.erlang-consulting.com > > Suresh S wrote: > > > Hi , > > > > Is there any best recommended tool for testing an > > erlang application, or any erlang module. > > > > Thanking u for ur time > > > > suresh s > > > > > > > > ________________________________________________________________________ > > Missed your favourite TV serial last night? Try the new, Yahoo! TV. > > visit http://in.tv.yahoo.com > > > > > > > -- Micael Karlberg Ericsson AB, ?lvsj? Sweden Tel: +46 8 727 5668 EAB/UHK/KD - OTP Product Development ECN: 851 5668 Mail: micael.karlberg@REDACTED Fax: +46 8 727 5775 From kent@REDACTED Wed Feb 5 14:53:24 2003 From: kent@REDACTED (Kent Boortz) Date: 05 Feb 2003 14:53:24 +0100 Subject: Recent download statistics? In-Reply-To: <200302051307.h15D7BY01269@bonsai.fernuni-hagen.de> References: <200302051307.h15D7BY01269@bonsai.fernuni-hagen.de> Message-ID: > The latest download statistics I was able to spot on www.erlang.org > seems to be a year old. > > Is there a more recent one available? You can find some statistics at http://www.erlang.org/stats.html This doesn't cover mirros, FTP downloads, binary packages and Erlang distributed as part of Wings, kent From joe@REDACTED Wed Feb 5 14:58:00 2003 From: joe@REDACTED (Joe Armstrong) Date: Wed, 5 Feb 2003 14:58:00 +0100 (CET) Subject: New tutorial Message-ID: Hello everybody, A while back Todd Proebsting asked me how you build a simple fault-tolerant server. After a moment's thought I said "that's easy" After two moments thought I said "that's difficult" and after three moments thought I said "It's possible". To make something fault-tolerant you need at least two machines and you need to replicate things - if you think you can do this on one machine stop reading now and go play with visual basic ... I made myself a little client-server. The server is actually two servers and and data on these two servers is replicated using shared mnesia disk tables. The client knows about both servers - if server one is down it tries server two and vice versa, this is similar to DNS - the alternative is some complicated IP-failover stuff - which is very non-portable. Transactions between the client and (virtual) server are idempotent. The solution I came up with is not entirely obvious (at least it wasn't to me) but it is (hopefully) simple enough to be grokked if you know a small amount of Erlang. The solution and all the code are available at: http://www.sics.se/~joe/tutorials/robust_server.html All comments, corrections and improvements are welcomed. /Joe From Marc.Vanwoerkom@REDACTED Wed Feb 5 15:05:46 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Wed, 5 Feb 2003 15:05:46 +0100 (MET) Subject: Recent download statistics? In-Reply-To: (message from Kent Boortz on 05 Feb 2003 14:53:24 +0100) Message-ID: <200302051405.h15E5ka13067@bonsai.fernuni-hagen.de> > > The latest download statistics I was able to spot on www.erlang.org > > seems to be a year old. > > > > Is there a more recent one available? > > > You can find some statistics at > > > http://www.erlang.org/stats.html > Thanks. What I got before was http://www.erlang.org/statistics.pdf Hm, it took some time downloading the given link of yours, did the Erlang minions from this list slashdot it? :) Regards, Marc From Marc.Vanwoerkom@REDACTED Wed Feb 5 15:13:05 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Wed, 5 Feb 2003 15:13:05 +0100 (MET) Subject: Recent download statistics? In-Reply-To: (message from Kent Boortz on 05 Feb 2003 14:53:24 +0100) Message-ID: <200302051413.h15ED5614409@bonsai.fernuni-hagen.de> > This doesn't cover mirros, FTP downloads, binary packages and > Erlang distributed as part of Wings, I'm trying to estimate the monthly download rate of the Erlang distribution. 16119: 23.75%: 4/Feb/03 20:49: /download/otp_win32_R8B-1.exe 13475: 17.98%: 5/Feb/03 08:43: /download/otp_win32_R8B-0.exe 10539: 14.14%: 5/Feb/03 14:11: /download/otp_win32_R9B-0.exe 6183: 3.57%: 5/Feb/03 00:53: /download/otp_src_R8B-2.tar.gz 4695: 4.59%: 5/Feb/03 12:19: /download/otp_src_R9B-0.tar.gz 3677: 8.56%: 5/Feb/03 00:36: /download/otp_win32_R8B-2.exe Does this imply a rate of about 53000 Erlang downloads for January-begin February? Or am I misinterpreting those stats? Regards, Marc From enewhuis@REDACTED Wed Feb 5 15:13:50 2003 From: enewhuis@REDACTED (Eric Newhuis) Date: Wed, 5 Feb 2003 08:13:50 -0600 Subject: Erlang Extreme Programming & Refactoring, Was: non-telecom in erlang References: Message-ID: <004701c2cd20$cf11c110$0100a8c0@eavi> Erlang really is agile. FutureSource is using Erlang in an XP development environment. After doing this for a few months I am convinced that Erlang + Extreme Programming is the proper way to do software in our domain. Our domain is real-time market data analysis software and trading. > What tools do you use for unit tests and acceptance tests? Erlang Unit Tests (our approach) We use Erlang for developer tests since they are the simplest thing that could possibly work to test Erlang fully including the synchronization multiple processes. Each Erlang module has a partner _test.erl module. And each _test.erl module exports a single function all/0 that simply runs all tests. We rely solely on Erlang's powerful pattern matching to generate exceptions that stop the unit test. So most of our unit tests look like this: all () -> ok = test_addition (), ok = test_subtraction (), ok. test_addition () -> A = 1, B = 1, 2 = A + B, %% if there was a problem then this would exit with a badmatch ok. This keeps the 1000s of unit tests from generating noise unless something really breaks and so it is easier for us to fix things quickly because we see only those things that break. Erlang Acceptance Tests We use our own scripting language interpreted by a Perl script for the acceptance tests. We do this so it is easier for the cutomer to "get it". The scripting language is just a long list of simple commands with the customer's queries and expected data. The Perl underneath that is where we can code up some rather complex relationships among Erlang nodes. > What does it feel like to do refactoring in Erlang? Obviously you cannot use the C++ or Java cookbooks; one must understand the patterns and apply them. There are many things like MoveMethod and RenameClass that fit well if you develop Erlang modules as ActiveObjects. InnapropriateIntimacy is there. And One handles this by extracting a new module. Refactoring is so important to software because it is really all about the patterns. You don't have to have a "traditional" OO language. Refactoring works in Erlang! Refactoring will make you a better Erlang developer. I can't prove it. But I'll show you personally in our development environment the next time any of you are in Chicago. Sincerely, Eric Newhuis From tony@REDACTED Thu Feb 6 02:08:07 2003 From: tony@REDACTED (Tony C. Thazhekkaden) Date: Wed, 05 Feb 2003 20:08:07 -0500 Subject: Do need a favour Message-ID: <3E41B577.4101CF17@innova.stph.net> Hi Sir, I would like to develop a remote host application which can receive traps from SNMP Agent(SNMP Servers) and log into the Error file. Since my development environment is C/C++ in Solaris, could you send me a sample application code, which can be understood by me to develop my own application. Apart from the above from the above, if you could elaborate the above little bit, i would be obliged to you. Thanks in advance, With regards, Tony From jocke@REDACTED Wed Feb 5 15:57:08 2003 From: jocke@REDACTED (Joakim G.) Date: Wed, 05 Feb 2003 15:57:08 +0100 Subject: New tutorial In-Reply-To: References: Message-ID: <3E412644.6060503@bluetail.com> Excellent /Jocke Joe Armstrong wrote: >Hello everybody, > > A while back Todd Proebsting asked me how you build a simple >fault-tolerant server. > > After a moment's thought I said "that's easy" > > After two moments thought I said "that's difficult" > > and after three moments thought I said "It's possible". > > To make something fault-tolerant you need at least two machines and >you need to replicate things - if you think you can do this on one >machine stop reading now and go play with visual basic ... > > I made myself a little client-server. The server is actually two >servers and and data on these two servers is replicated using shared >mnesia disk tables. > > The client knows about both servers - if server one is down it tries >server two and vice versa, this is similar to DNS - the alternative is >some complicated IP-failover stuff - which is very non-portable. > > Transactions between the client and (virtual) server are idempotent. > > The solution I came up with is not entirely obvious (at least it >wasn't to me) but it is (hopefully) simple enough to be grokked if you >know a small amount of Erlang. > > The solution and all the code are available at: > > http://www.sics.se/~joe/tutorials/robust_server.html > > All comments, corrections and improvements are welcomed. > > /Joe > > > From Chandrashekhar.Mullaparthi@REDACTED Wed Feb 5 16:04:18 2003 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Wed, 5 Feb 2003 15:04:18 -0000 Subject: Do need a favour Message-ID: Tony, Look at the snmp_mgr module. I think this will suit your needs. erl -man snmp_mgr cheers Chandru -----Original Message----- From: Tony C. Thazhekkaden [mailto:tony@REDACTED] Sent: 06 February 2003 01:08 To: erlang-questions@REDACTED Subject: Do need a favour Hi Sir, I would like to develop a remote host application which can receive traps from SNMP Agent(SNMP Servers) and log into the Error file. Since my development environment is C/C++ in Solaris, could you send me a sample application code, which can be understood by me to develop my own application. Apart from the above from the above, if you could elaborate the above little bit, i would be obliged to you. Thanks in advance, With regards, Tony 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 Wed Feb 5 16:32:02 2003 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Wed, 5 Feb 2003 15:32:02 -0000 Subject: Do need a favour Message-ID: Sorry, It's been pointed out to me that you are looking for C/C++ code. This is a mailing list for the programming language erlang - using which you can do what you need in about half an hour. That is after you learn the language ofcourse :) which should take you about a week! cheers Chandru -----Original Message----- From: Chandrashekhar Mullaparthi [mailto:Chandrashekhar.Mullaparthi@REDACTED] Sent: 05 February 2003 15:04 To: 'Tony C. Thazhekkaden'; erlang-questions@REDACTED Subject: RE: Do need a favour Tony, Look at the snmp_mgr module. I think this will suit your needs. erl -man snmp_mgr cheers Chandru -----Original Message----- From: Tony C. Thazhekkaden [mailto:tony@REDACTED] Sent: 06 February 2003 01:08 To: erlang-questions@REDACTED Subject: Do need a favour Hi Sir, I would like to develop a remote host application which can receive traps from SNMP Agent(SNMP Servers) and log into the Error file. Since my development environment is C/C++ in Solaris, could you send me a sample application code, which can be understood by me to develop my own application. Apart from the above from the above, if you could elaborate the above little bit, i would be obliged to you. Thanks in advance, With regards, Tony 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. 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 joe@REDACTED Wed Feb 5 16:32:16 2003 From: joe@REDACTED (Joe Armstrong) Date: Wed, 5 Feb 2003 16:32:16 +0100 (CET) Subject: New tutorial In-Reply-To: <3E412644.6060503@bluetail.com> Message-ID: On Wed, 5 Feb 2003, Joakim G. wrote: > Excellent Thank you. If you like I can *volunteer* to write some new tutorials and copy-edit any tutorials that other people might like to write. If you like the idea you can do one of a number of things 1) suggest a new topic that interests you 2) volunteer to write a topic 3) vote for a topic on the list Can we try to use the wiki for this (the wiki is not used much for reasons I don't understand) go and add your comments at <