but the Sara server only gets the message AFTER i abort the GUI client

That is a big clue.

To bring the other monks up to date, I was privately contacted by email about this and proposed that the problem is in his client's socket sub, where he has socket code which will block the gui.

sub lee_socket { print "lee_socket\n"; my $conexion = $Socket_->accept(); my $mensaje; while( defined( my $buffer = <$Socket_> ) ) # read from the socket { print "From client: $buffer" ; $mensaje = $mensaje . $buffer ; } close($Socket_); }

I sent him fileevent code to replace this, but he hasn't responded as to whether it worked or not. The code was part of a simpler example, which wasn't obscured by the spaghetti complexity of the ini files, and long mexican variable names.

$mw ->fileevent($socket, readable => sub { my $line = <$socket>; unless (defined $line) { $mw->fileevent($socket => readable => ''); return; } $log->insert(end => $line); });

My advice, if you want to get people to answer this, is to present a simpler example. With all the complex ini files, and the need to create special files on my system, just to test your script, I will just think " hope someone knows this" and move on. Please try to remake your example code, to be a self contained server and client, which runs on localhost, and demonstrates your problem. Get rid of the ini crap and hardwire in the values, so all we have to do is start the server, and client and see what happens.

If you can't take the time to simplify(and clarify) your problem, why should we?


I'm not really a human, but I play one on earth. flash japh

In reply to Re: perl/tk sockets and fileevent by zentara
in thread perl/tk sockets and fileevent by HeatSeekerCannibal

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.