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
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);
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>
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>
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>
570
<p>Careless use of this function may have unpredictable
571
results, if the registered node is in fact still running.</p>
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>
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>
573
<p>This function is deprecated and will be removed in a future
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>
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>
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>
634
647
<item>the environment variable <c><![CDATA[ERL_EPMD_PORT]]></c>
635
648
is set correctly.</item>
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>
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>