[Perl-unix-users] (no subject)

2001-11-01 Thread Vadim K


 Dood day!
 I wrote a server which listens on a specific port and 
for each client splits child proccess (using fork()). 
I need to exchange between them (proccesses). I tried 
to use pipe (used socketpair function), but can create 
only one.   
 I have such a general question: How to organize 
interconnection between proccesses though server? How 
does server know which client sends data (proccess 
identification) and how can it send data to a cpecific 
client?
 Thank you.
 
P.S. Used IO::Socket

/Vadim/  
mailto:[EMAIL PROTECTED]
___
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users



RE: [Perl-unix-users] (no subject)

2001-11-01 Thread Elston, Jeremy

Greetings...

I have a large client-server application in production now.  My choice was
to use sockets for communication.  IPC turned out to be too slow and
troublesome for the volume of data.  Plus, I wanted to have the flexibility
of placing client processes on separate servers in the future (my client and
server parent processes are separate).  Each client connects to the server
and sends a command identifying itself (process ID).  The server checks the
client's hostname with $client->peerhost (peeraddr also works I believe).
Client requests the data and the server sends it back.  Once you have the
socket connection, just communicate back and forth.  Although it is costly
to "change direction" frequently.  In my case, my client sends all the data
the server needs then the server responds.  Close connection.

Client identification is up to you.  Use something that is unique.  I found
hostname + PID to work well.

As far as the server contacting the client - is that the best way?  Becomes
more of a server-server architecture then, I would think?  Client calls the
server, the server listens.  If the client is also listening then it becomes
the server.  A confusing duality to be sure.

The only way that I could think to manage this with sockets would be to have
each client bind to a different port and communicate that information to the
server at startup.  Server would then have to keep track of the info.
Personally, I do not think this is a good direction to follow at all.  You
can use signals to communicate from server to client, but you can not really
send useful information that way.

Hope that helps you,


Jeremy Elston 
Sr. Staff Unix System Administrator 
Electronic Brokerage Technology 
Charles Schwab & Co., Inc. 
(602.977.4413 [EMAIL PROTECTED]) 

"Are you still here?š What are you doing?š There is nothing left to
read.š The e-mailšis over.š Move on...š Go on -šget out of here.š SHOO!"


WARNING:š All email sent to this address will be received by the Charles
Schwab Corporate email system and is subject to archival and review by
someone other than the recipient



-Original Message-
From: Vadim K [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 01, 2001 1:34 AM
To: [EMAIL PROTECTED]
Subject: [Perl-unix-users] (no subject)



 Dood day!
 I wrote a server which listens on a specific port and 
for each client splits child proccess (using fork()). 
I need to exchange between them (proccesses). I tried 
to use pipe (used socketpair function), but can create 
only one.   
 I have such a general question: How to organize 
interconnection between proccesses though server? How 
does server know which client sends data (proccess 
identification) and how can it send data to a cpecific 
client?
 Thank you.
 
P.S. Used IO::Socket

/Vadim/  
mailto:[EMAIL PROTECTED]
___
Perl-Unix-Users mailing list. To unsubscribe go to
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users
___
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users



RE: [Perl-unix-users] (no subject)

2001-11-01 Thread david . b . deline

Look into DBM files.
I've created a process that is similar to yours (parent process forks
child processes) and they are all daemons.  I used a DBM file to
communicate between them.  The only draw back was you will have to
implement a file locking schema to prevent corrupting your DBM file.

Regards,
Dave DeLine


-Original Message-
From: mogikan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 01, 2001 2:34 AM
To: perl-unix-users
Cc: mogikan
Subject: [Perl-unix-users] (no subject)



 Dood day!
 I wrote a server which listens on a specific port and 
for each client splits child proccess (using fork()). 
I need to exchange between them (proccesses). I tried 
to use pipe (used socketpair function), but can create 
only one.   
 I have such a general question: How to organize 
interconnection between proccesses though server? How 
does server know which client sends data (proccess 
identification) and how can it send data to a cpecific 
client?
 Thank you.
 
P.S. Used IO::Socket

/Vadim/  
mailto:[EMAIL PROTECTED]
___
Perl-Unix-Users mailing list. To unsubscribe go to
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users


___
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users



[Perl-unix-users] Mime::Lite and different mail readers

2001-11-01 Thread Troy Sniff

Hey everyone,

I am using Mime::Lite to send a bit of email.  Sometimes it will be with
an attachment and sometimes it will be without.

This is my code:

-
if ($AttachFile)
 {
$msg = MIME::Lite->new(
  To=> $To,
From=> $From,
Subject => $Subj,
  cc=> $CC, 
Bcc => $BCC,
'X-MSMail-Priority' => $Priority,
'Importance' => $Priority,
'X-Mail-Sender' => 'My Sender',
Type=> 'multipart/mixed'
);
$msg->attach(
 Type   => 'text/html',
Data=> 'This is a test'
);
$AttachType = 'base64' unless $AttachType;
$msg->attach(
Type=> $AttachType,
Path=> $AttachFile,
);
 }
else
 {
$msg = MIME::Lite->new(
To  => $To,
From=> $From,
Subject => $Subj,
cc  => $CC, 
Bcc => $BCC,
'X-MSMail-Priority' => $Priority,
'Importance' => $Priority,
'X-Mail-Sender' => 'My Sender',
Type=> 'text/html',
Data=> 'This is a test'
);
 } 


When I send mail with an attachment, the mail looks good in Outlook,
Outlook Express, Netscape mail, but in Eudora it will look like:

--
Subject: Test

Content-Disposition: inline
Content-Length: 1179
Content-Transfer-Encoding: binary
Content-Type: text/html

This is a test

Content-Disposition: inline; filename="files.zip"
Content-Type: base64; name="files.zip"


It adds all the visible 'content-' stuff.

Anyone know how I can convince Mime::Lite to get rid in Eudora?

Thanks,

Troy

___
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users



[Perl-unix-users] Crypt function for MD5

2001-11-01 Thread Alex Moen

Hey all,

I am using a crypt function in a script to check a password... here's a
snippet:

   # Match current passwd...
   $pass = $ent[1];
   $salt=substr($pass,0,2);
   $encrypt = crypt($oldpass, $salt);
   if ($pass ne $encrypt) {
  warn "Wrong password entered for $username";
  &auth_fail;
  return;
   }

How do I do the same thing with an MD5/shadow setup?

Thanks!

Alex

___
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users



[Perl-unix-users] Script works on Windows server but not on UNIX server

2001-11-01 Thread Britt



I am puzzeled that a script will work on Windows 
servers and not on UNIX servers.Even a script as simple as hello.pl
 
 
 
Any ideas for a 
begginer?


Re: [Perl-unix-users] Script works on Windows server but not on UNIXserver

2001-11-01 Thread Edward Moon

You can run into an issue if you are using DOS/Win32 based linebreaks
(CRLF) versus Unix based linebreaks (LF I think).


On Thu, 1 Nov 2001, Britt wrote:

> I am puzzeled that a script will work on Windows servers and not on UNIX 
>servers.Even a script as simple as hello.pl
>
>
>
> Any ideas for a begginer?
>

___
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users



Re: [Perl-unix-users] Script works on Windows server but not on UNIX server

2001-11-01 Thread $Bill Luebkert

> Britt wrote:
> 
> I am puzzeled that a script will work on Windows servers and not on UNIX 
>servers.Even a script as simple as hello.pl
> 
> 
> 
> Any ideas for a begginer?

1) Yes, don't post in HTML.

2) The most important part is what webserver you are using (Apache, IIS, etc.) 
   and you didn't supply it.

3) If your server is owned by your ISP - that config could be radically 
   different from the normal setup.

More info please.  Make sure you're script is in your cgi-bin dir 
and has the right perms on it 0755 usually.

-- 
  ,-/-  __  _  _ $Bill Luebkert   ICQ=14439852
 (_/   /  )// //   DBE Collectibles   Mailto:[EMAIL PROTECTED] 
  / ) /--<  o // //  http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_http://www.todbe.com/
___
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users