Minta nya pake apa, ini aku ada contoh u/ Perl :
Server :
# Server Program
use IO::Socket::INET;
print ">> Server Program <<\n";
# Create a new socket
$MySocket=new IO::Socket::INET->new(LocalPort=>1234,Proto=>'udp');
# Keep receiving messages from client
$def_msg="\nReceiving message from client.....\n";
while(1)
{
$MySocket->recv($text,128);
if($text ne '')
{
print "\nReceived message '", $text,"'\n";
}
# If client message is empty exit
else
{
print "Cilent has exited!";
exit 1;
}
}
Client :
#Client Program
use IO::Socket::INET;
print ">> Client Program <<";
# Create a new socket
$MySocket=new
IO::Socket::INET->new(PeerPort=>1234,Proto=>'udp',PeerAddr=>'localhost');
# Send messages
$def_msg="Enter message to send to server : ";
print "\n",$def_msg;
while($msg=<STDIN>)
{
chomp $msg;
if($msg ne '')
{
print "\nSending message '",$msg,"'";
if($MySocket->send($msg))
{
print ".....<done>","\n";
print $def_msg;
}
}
else
{
# Send an empty message to server and exit
$MySocket->send('');
exit 1;
}
}
Cara compilenya : perl server/client.
Jika ada error, tolong kasih tau dimana errornya. Di punyaku script ini jalan
dengan baik.
On Thursday 27 March 2003 08:33, [EMAIL PROTECTED] wrote:
> salam .... buat admin' yg jago'
> minta tolong nich !.... :)
> ada ngga yang bisa ngasih script buatin client ama server socket ?
> pease......
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]