~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/erl_interface/doc/src/ei_connect.xml

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
<cref>
5
5
  <header>
6
6
    <copyright>
7
 
      <year>2001</year><year>2009</year>
 
7
      <year>2001</year><year>2010</year>
8
8
      <holder>Ericsson AB. All Rights Reserved.</holder>
9
9
    </copyright>
10
10
    <legalnotice>
54
54
      the operation, if the primitive does not complete within the time
55
55
      specified, the function will return an error and
56
56
      <c><![CDATA[erl_errno]]></c> will be set to <c><![CDATA[ETIMEDOUT]]></c>. With
57
 
      communication primitive is ment an operation on the socket, like
 
57
      communication primitive is meant an operation on the socket, like
58
58
      <c><![CDATA[connect]]></c>, <c><![CDATA[accept]]></c>, <c><![CDATA[recv]]></c> or <c><![CDATA[send]]></c>.</p>
59
59
    <p>Obviously the timeouts are for implementing fault tolerance,
60
60
      not to keep hard realtime promises. The <c><![CDATA[_tmo]]></c> functions
116
116
int n = 0;
117
117
struct in_addr addr;
118
118
ei_cnode ec;
119
 
addr = inet_addr("150.236.14.75");
 
119
addr.s_addr = inet_addr("150.236.14.75");
120
120
if (ei_connect_xinit(&ec,
121
121
                     "chivas",
122
122
                     "madonna",
132
132
          </p>
133
133
        <code type="none"><![CDATA[
134
134
if (ei_connect_init(&ec, "madonna", "cookie...", n++) < 0) {
135
 
    fprintf("ERROR when initializing: %d",erl_errno);
 
135
    fprintf(stderr,"ERROR when initializing: %d",erl_errno);
136
136
    exit(-1);
137
137
}
138
138
        ]]></code>
177
177
 
178
178
/*** Variant 2 ***/
179
179
struct in_addr addr;
180
 
addr = inet_addr(IP_ADDR);
 
180
addr.s_addr = inet_addr(IP_ADDR);
181
181
fd = ei_xconnect(&ec, &addr, ALIVE);
182
182
        ]]></code>
183
183
      </desc>
508
508
          same as the port number that was previously bound to the socket.</p>
509
509
        <p><c><![CDATA[addr]]></c> is the 32-bit IP address of the local host.</p>
510
510
        <p>To unregister with epmd, simply close the returned
511
 
          descriptor. See also <c><![CDATA[ei_unpublish()]]></c>.</p>
 
511
          descriptor. Do not use <c><![CDATA[ei_unpublish()]]></c>, which is deprecated anyway.</p>
512
512
        <p>On success, the functions return a descriptor connecting the
513
513
          calling process to epmd. On failure, they return -1 and set
514
514
          <c><![CDATA[erl_errno]]></c> to <c><![CDATA[EIO]]></c>.</p>
558
558
    </func>
559
559
    <func>
560
560
      <name><ret>int</ret><nametext>ei_unpublish(ei_cnode *ec)</nametext></name>
561
 
      <fsummary>Unpublish a node name</fsummary>
 
561
      <fsummary>Forcefully unpublish a node name</fsummary>
562
562
      <desc>
563
563
        <p>This function can be called by a process to unregister a
564
 
          specified node from epmd on the localhost. This may be
565
 
          useful, for example, when epmd has not detected the failure of a
566
 
          node, and will not allow the name to be reused. If you use this
567
 
          function to unregister your own process, be sure to also close
568
 
          the descriptor that was returned by <c><![CDATA[ei_publish()]]></c>.</p>
569
 
        <note>
570
 
          <p>Careless use of this function may have unpredictable
571
 
            results, if the registered node is in fact still running.</p>
572
 
        </note>
 
564
          specified node from epmd on the localhost. This is however usually not 
 
565
          allowed, unless epmd was started with the -relaxed_command_check 
 
566
          flag, which it normally isn't.</p>
 
567
 
 
568
          <p>To unregister a node you have published, you should
 
569
          close the descriptor that was returned by  
 
570
          <c><![CDATA[ei_publish()]]></c>.</p> 
 
571
 
 
572
        <warning>
 
573
          <p>This function is deprecated and will be removed in a future 
 
574
          release.</p>
 
575
        </warning>
573
576
        <p><c><![CDATA[ec]]></c> is the node structure of the node to unregister.</p>
574
577
        <p>If the node was successfully unregistered from epmd, the
575
578
          function returns 0. Otherwise, it returns -1 and sets
619
622
        <p>These are convenience functions for some common name lookup functions.</p>
620
623
      </desc>
621
624
    </func>
 
625
    <func>
 
626
      <name><ret>int</ret><nametext>ei_get_tracelevel(void)</nametext></name>
 
627
      <name><ret>void</ret><nametext>ei_set_tracelevel(int level)</nametext></name>
 
628
      <fsummary>Get and set functions for tracing.</fsummary>
 
629
      <desc>
 
630
        <p>These functions are used to set tracing on the distribution. The levels are different verbosity levels. A higher level means more information.
 
631
        See also Debug Information and <c><![CDATA[EI_TRACELEVEL]]></c> below. </p>
 
632
        <p> <c><![CDATA[ei_set_tracelevel]]></c> and <c><![CDATA[ei_get_tracelevel]]></c> are not thread safe.  </p>
 
633
      </desc>
 
634
    </func>
622
635
  </funcs>
623
636
 
624
637
  <section>
634
647
      <item>the environment variable <c><![CDATA[ERL_EPMD_PORT]]></c>
635
648
       is set correctly.</item>
636
649
    </list>
 
650
    <p>The connection attempt can be traced by setting a tracelevel by either using
 
651
    <c><![CDATA[ei_set_tracelevel]]></c> or by setting the environment variable <c><![CDATA[EI_TRACELEVEL]]></c>.
 
652
    The different tracelevels has the following messages:</p>
 
653
    <list>
 
654
        <item>1: Verbose error messages</item>
 
655
        <item>2: Above messages and verbose warning messages </item>
 
656
        <item>3: Above messages and progress reports for connection handling</item>
 
657
        <item>4: Above messages and progress reports for communication</item>
 
658
        <item>5: Above messages and progress reports for data conversion</item>
 
659
    </list>
637
660
  </section>
 
661
 
638
662
</cref>
639
663