<div dir="ltr">hi guys, i'm with a newbie question<div><br></div><div><br></div><div>i have this piece of code, but i'm not finding something similar with c++, could anyone help? thanks:</div><div><br></div><div><br></div><div><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New""><span style="color:rgb(0,0,128);font-weight:bold">import </span>socket<br><span style="color:rgb(0,0,128);font-weight:bold">import </span>ssl<br><span style="color:rgb(0,0,128);font-weight:bold">import </span>sys<br><span style="color:rgb(0,0,128);font-weight:bold">if </span>len(sys.argv) == <span style="color:rgb(0,0,255)">3</span>:<br>   HOST = sys.argv[<span style="color:rgb(0,0,255)">1</span>]     <span style="color:rgb(128,128,128);font-style:italic"># IP<br></span><span style="color:rgb(128,128,128);font-style:italic">   </span>PORT = int(sys.argv[<span style="color:rgb(0,0,255)">2</span>])  <span style="color:rgb(128,128,128);font-style:italic"># Port<br></span><span style="color:rgb(0,0,128);font-weight:bold">else</span>:<br>   <span style="color:rgb(0,0,128);font-weight:bold">print </span><span style="color:rgb(0,128,0);font-weight:bold">"USAGE: $python client_ssl.py <server_ip> <port>"<br></span><span style="color:rgb(0,128,0);font-weight:bold">   </span>exit(<span style="color:rgb(0,0,255)">1</span>)<br><span style="color:rgb(0,0,128);font-weight:bold">print </span><span style="color:rgb(0,128,0);font-weight:bold">'Connecting...'<br></span>s = socket.create_connection((HOST, PORT))<br>s = ssl.wrap_socket(s)<br><span style="color:rgb(0,0,128);font-weight:bold">print </span><span style="color:rgb(0,128,0);font-weight:bold">"Connected!</span><span style="color:rgb(0,0,128);font-weight:bold">\n</span><span style="color:rgb(0,128,0);font-weight:bold">"<br></span><span style="color:rgb(0,0,128);font-weight:bold">while </span><span style="color:rgb(0,0,128)">True</span>:<br><span style="color:rgb(128,128,128);font-style:italic">   </span>query = raw_input(<span style="color:rgb(0,128,0);font-weight:bold">"Query: "</span>)<br>   <span style="color:rgb(0,0,128);font-weight:bold">if </span>( query == <span style="color:rgb(0,128,0);font-weight:bold">"quit" </span>):<br>      <span style="color:rgb(0,0,128);font-weight:bold">break<br></span><span style="color:rgb(128,128,128);font-style:italic">   </span>s.send(query)<br><span style="color:rgb(128,128,128);font-style:italic">   </span>data = s.recv(<span style="color:rgb(0,0,255)">16384</span>)<br>   <span style="color:rgb(0,0,128);font-weight:bold">print </span><span style="color:rgb(0,128,0);font-weight:bold">'Reply:'</span>, data<br>s.close()<br></pre><br></div><div><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr">Roberto Spadim<br></div></div></div>
</div></div>