spx2 has asked for the wisdom of the Perl Monks concerning the following question:

i have a big problem while making a
script that is both server and client.
the program im trying to make will actually be
node 2 in a configuration like this

1<->2<->3

1 server to 2,2 client to 1,2 server to 3,3 client to 2.


ok,now i open on 2 a ftp connection to 1 and(2 beeing
client in this case) ,
i also open a socket for it to be able to communicate
to 3(2 beeing server in this case).

my problem appears in the code,its not that i get any
compile error,interpreter error or anything like that.
its just that if i socket->accept() then the
ftp connection stops working.
i must specify that i do not use the socket on the same
port as ftp(21 as you know).

what can i do ?
thank you

Replies are listed 'Best First'.
Re: ftp and sockets
by Fletch (Bishop) on Jan 12, 2007 at 04:31 UTC

    Well, without any actual code to look at it's all conjecture but: a call to accept will block until a connection is received. If you want to continue processing you'll need to use select or IO::Select to manage multiple connections, or use an event framework like POE.

      thank you,i will read those right away.
      i'm a little sceptic on poe as it is a
      framework and i will have to give it more
      time...i will leave poe for later.