From: Marc S. <ms...@ba...> - 2004-06-03 16:09:58
|
Hi ! I´m currently developing with two other students a management-solution for uml-systems. We are currently interfacing with uml_mconsole, but we would like to reduce that dependency. "uml_mconsole" uses this connection-type: .. if((fd = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0){ .. But I have tried to get a connection with this sample-code, but I was not very successful. -- #!/usr/bin/perl -W # # $Id: client,v 1.4 2004/03/05 13:32:55 it01138 Exp $ # use Socket; use strict; my ($rendezvous, $line); $SIG{'PIPE'} = sub{ print "SigPIPE received.\nServer connection died.\n"; exit(0); }; $SIG{'INT'} = sub{ print "\r\nSigINT received.\r\nClient exits...\r\n"; close( SOCK ); exit(0); }; $rendezvous = shift || "$ENV{'HOME'}/.umlmgr/umlmgrd/socket.ctl"; socket(SOCK, PF_UNIX, SOCK_DGRAM, 0) || die "socket: $!"; connect(SOCK, sockaddr_un($rendezvous)) || die "connect: $!"; # set unbuffered my $alt = select SOCK; $|=1; select $alt; $|=1; send(SOCK,"help",0); my $out = ""; recv(SOCK, $out,0,0); print $out."\n";; close( SOCK ); exit; -- The code runs without error-messages but does nothing :-) Does anybody have a ide how to communicate with the uml-system with Perl ? Sorry - I don´t know so much about sockets, maybe this way is completely wrong.... Best regards Marc Schoechlin -- Marc Schoechlin | LF.net GmbH | fon +49 711 90074-413 | Ruppmannstr. 27 | fax +49 711 90074-33 ms@LF.net | D-70565 Stuttgart | http://www.lf.net |