<html>

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:Arial;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.Typed
        {font-family:"Courier New";}
span.tty
        {font-family:"Courier New";}
span.Name
        {font-style:italic;}
span.Variable
        {font-family:"Times New Roman";
        font-style:italic;}
span.typed0
        {font-family:"Courier New";}
span.name0
        {font-style:italic;}
span.variable0
        {font-family:"Times New Roman";
        font-style:italic;}
span.emailstyle21
        {font-family:Arial;
        color:windowtext;}
span.EmailStyle26
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;color:navy'>Yes, I am an
idiot.  The problem, of course, is that </span><span style='font-size:
11.0pt;font-family:Consolas;color:navy'>S</span><span style='font-size:11.0pt;
color:navy'> is the tuple </span><span style='font-size:11.0pt;font-family:
Consolas;color:navy'>{ok,#Port<0.110>}</span><span style='font-size:11.0pt;
color:navy'>.  It works fine when I actually pay attention:</span></p>

<p class=MsoNormal><span style='font-size:11.0pt;color:navy'> </span></p>

<p class=MsoNormal style='margin-left:.5in;background:black'><span
style='font-size:11.0pt;font-family:Consolas;color:lime'>32> <b>{ok, S} =
gen_tcp:connect("localhost", 1210, [{active, once}]).</b></span></p>

<p class=MsoNormal style='margin-left:.5in;background:black'><span
style='font-size:11.0pt;font-family:Consolas;color:lime'>{ok,#Port<0.113>}</span></p>

<p class=MsoNormal style='margin-left:.5in;background:black'><span
style='font-size:11.0pt;font-family:Consolas;color:lime'>33> <b>inet:getopts(S,
[active]).</b>                                    
</span></p>

<p class=MsoNormal style='margin-left:.5in;background:black'><span
style='font-size:11.0pt;font-family:Consolas;color:lime'>{ok,[{active,once}]}</span></p>

<p class=MsoNormal><span style='font-size:11.0pt;color:navy'> </span></p>

<p class=MsoNormal><span style='font-size:11.0pt;color:navy'>Sorry for the
waste of bandwidth.</span></p>

<p class=MsoNormal><span style='font-size:11.0pt;color:navy'> </span></p>

<p class=MsoNormal><span style='font-size:11.0pt;color:navy'>David</span></p>

<p class=MsoNormal><span style='color:navy'> </span></p>

<div>

<div class=MsoNormal align=center style='text-align:center'>

<hr size=2 width="100%" align=center tabindex=-1>

</div>

<p class=MsoNormal><b><span style='font-family:Tahoma'>From:</span></b><span
style='font-family:Tahoma'> David Mercer [mailto:dmercer@gmail.com] <br>
<b>Sent:</b> Wednesday, August 08, 2007 11:06<br>
<b>To:</b> 'Erlang Questions'<br>
<b>Subject:</b> inet:getopts</span></p>

</div>

<p class=MsoNormal> </p>

<p class=MsoNormal><span style='font-size:12.0pt'>I can never get any good
response out of </span><span style='font-size:12.0pt;font-family:Consolas'>inet:getopts/2</span><span
style='font-size:12.0pt'>:</span></p>

<p class=MsoNormal><span style='font-size:12.0pt'> </span></p>

<p class=MsoNormal style='margin-left:.5in;background:black'><span
style='font-size:12.0pt;font-family:Consolas;color:lime'>1> <b>S =
gen_tcp:connect("localhost", 1210, [{active, once}]).</b></span></p>

<p class=MsoNormal style='margin-left:.5in;background:black'><span
style='font-size:12.0pt;font-family:Consolas;color:lime'>{ok,#Port<0.110>}</span></p>

<p class=MsoNormal style='margin-left:.5in;background:black'><span
style='font-size:12.0pt;font-family:Consolas;color:lime'>2> <b>inet:getopts(S,
[active]).</b>                              
</span></p>

<p class=MsoNormal style='margin-left:.5in;background:black'><span
style='font-size:12.0pt;font-family:Consolas;color:lime'> </span></p>

<p class=MsoNormal style='margin-left:.5in;background:black'><span
style='font-size:12.0pt;font-family:Consolas;color:lime'>=ERROR REPORT====
8-Aug-2007::10:36:53 ===</span></p>

<p class=MsoNormal style='margin-left:.5in;background:black'><span
style='font-size:12.0pt;font-family:Consolas;color:lime'>Error in process
<0.62.0> with exit value: {function_clause,[{prim_inet,getopts,</span></p>

<p class=MsoNormal style='margin-left:.5in;background:black'><span
style='font-size:12.0pt;font-family:Consolas;color:lime'>[{ok,#Port<0.110>},[active]]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_</span></p>

<p class=MsoNormal style='margin-left:.5in;background:black'><span
style='font-size:12.0pt;font-family:Consolas;color:lime'>loop,3}]}</span></p>

<p class=MsoNormal style='margin-left:.5in;background:black'><span
style='font-size:12.0pt;font-family:Consolas;color:lime'> </span></p>

<p class=MsoNormal style='margin-left:.5in;background:black'><span
style='font-size:12.0pt;font-family:Consolas;color:lime'>** exited:
{function_clause,[{prim_inet,getopts,[{ok,#Port<0.110>},[active]]},</span></p>

<p class=MsoNormal style='margin-left:.5in;background:black'><span
style='font-size:12.0pt;font-family:Consolas;color:lime'>                            
{erl_eval,do_apply,5},</span></p>

<p class=MsoNormal style='margin-left:.5in;background:black'><span
style='font-size:12.0pt;font-family:Consolas;color:lime'>                            
{shell,exprs,6},</span></p>

<p class=MsoNormal style='margin-left:.5in;background:black'><span
style='font-size:12.0pt;font-family:Consolas;color:lime'>                            
{shell,eval_loop,3}]} **</span></p>

<p class=MsoNormal><span style='font-size:12.0pt'> </span></p>

<p class=MsoNormal><span style='font-size:12.0pt'>I have confirmed that I am
successfully making the connection.  What am I doing wrong?  I do not
understand the error report.  Please advise.  Thank-you.</span></p>

<p class=MsoNormal><span style='font-size:12.0pt'> </span></p>

<p class=MsoNormal><span style='font-size:12.0pt'>David Mercer</span></p>

</div>

</body>

</html>