Note that there are some explanatory texts on larger screens.

plurals
  1. POPerl client/server socket
    primarykey
    data
    text
    <blockquote> <pre><code>--|proxy|--|mux|--|demux|--|proxy|-- -- -- -- machineA satellite link machineB </code></pre> <p>172.16.1.224 172.16.1.218</p> </blockquote> <p>Greetings,</p> <p>I have setup as above. I'm trying to create 'mux'. Basically, it reads traffic from a proxy and splits it up for transmission over 4 wires. The 'demux' reads off 4 wires and forwards traffic on to the proxy.</p> <p>I've got a basic client/server setup in Perl. But I don't know how to get traffic from the proxy into 'mux'?</p> <p>Here is my code:</p> <p><strong>server.pl</strong> -- runs on 172.16.1.218</p> <pre><code>use IO::Socket; $| = 1; $socket = new IO::Socket::INET ( LocalHost =&gt; '172.16.1.218', LocalPort =&gt; '5000', Proto =&gt; 'tcp', Listen =&gt; 5, Reuse =&gt; 1 ); die "Coudn't open socket" unless $socket; print "\nTCPServer Waiting for client on port 5000"; while(1) { $client_socket = ""; $client_socket = $socket-&gt;accept(); $peer_address = $client_socket-&gt;peerhost(); $peer_port = $client_socket-&gt;peerport(); #print "\n I got a connection from ( $peer_address , $peer_port ) "; while (1){ $send_data = &lt;STDIN&gt;; $client_socket-&gt;send($send_data); $client_socket-&gt;recv($recieved_data,10); print $recieved_data;#."\n"; #$client_socket-&gt;autoflush(); } } </code></pre> <p>and:</p> <p><strong>client.pl</strong></p> <pre><code>use IO::Socket; $socket = new IO::Socket::INET ( PeerAddr =&gt; '172.16.1.224', PeerPort =&gt; 5000, Proto =&gt; 'tcp', ) or die "Couldn't connect to Server\n"; while (1) { $socket-&gt;recv($recv_data,10); print $recv_data."\n"; $send_data = &lt;STDIN&gt;; $socket-&gt;send($send_data); } </code></pre> <p>I'm just a bit stuck and would appreciate any comments. </p> <p>Many thanks in advance,</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload