Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: perl : Passing hash , array through socket program betwen client and server

by BrowserUk (Patriarch)
on May 13, 2010 at 06:20 UTC ( [id://839781]=note: print w/replies, xml ) Need Help??


in reply to perl : Passing hash , array through socket program betwen client and server

A couple of things:

  1. You'd almost certainly be better to use Storable freeze/thaw to serialise data for transmission via a socket.

    It packs and unpacks faster; is more compact and therefore transmits faster; and doesn't rely upon eval for unpacking and is therefore safer.

  2. A proto 'tcp' listening port combined with a 'tcp' client connect, does not make for a "UDP server".
    IO::Socket::INET->new(LocalPort=>5000,Proto=>'tcp',Localhost => 'localhost','Listen' => 5 , 'Reuse' => 1 ); die "could not create $! \n" unless ( $socket ); print "\nUDPServer Waiting port 5000\n"; .... my $socket = new IO::Socket::INET ( PeerAddr => $host , PeerPort => $port , Proto => 'tcp', )

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: perl : Passing hash , array through socket program betwen client and server
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://839781]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-25 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found