I tried Wx::Socket. I got error loading wxSOCKET_WAITALL

Here's my Tk Version so far.

#!/usr/local/bin/perl use Tk; use IO::Socket; use Net::Address::IP::Local; use Sys::Hostname; use Socket; use Socket; use IO::Socket::INET; my $address = Net::Address::IP::Local->public; my($ipaddr)=inet_ntoa((gethostbyname(hostname))[4]); $local = IO::Socket::INET->new( Proto => 'tcp', LocalAddr => "$ipaddr:8087", ) or die "$!"; $local->listen(); $local->autoflush(1); my $addr; #Not sure why I have this while ($addr = $local->accept() ) { print "Connection from: ", $addr->peerhost(),"\n"; print "Ready for command.\n\n"; $path = "C:/Program Files (x86)/Common Files/X10/Common"; chdir($path) or die "Cant chdir to $path $!"; #Don't know what + this does ~s/GET//g,~s/~/ /g,~s/%20/ /g,~s/%22/ /g,~s/x10command=DEVICE/ +/g, ~s/\//\ /g,~s/[?]//g ,~s/'/ /g,~s/HTTP/ /g,~s/1.1/ /g; system(AHCMD. "$_"); my $mw = new MainWindow; my $frm_name = $mw -> Frame() -> pack(); my $lab = $frm_name -> Label(-text=>"Your IP is $address Port 8087") + -> pack(); my $but = $mw -> Button(-text=>"Launch Server", -command =>\&push_butt +on) -> pack(); my $txt = $mw -> Text(-width=>40, -height=>25) -> pack(); #Needs to be + multi line. MainLoop; sub push_button { #Rather than push button, I need the client to tri +gger this @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); @weekDays = qw(Sun Mon Tue Wed Thu Fri Sat Sun); ($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWee +k, $dayOfYear, $daylightSavings) = localtime(); $year = 1900 + $yearOffset; $theTime = "$hour:$minute:$second, $weekDays[$dayOfWeek] $months[$mon +th] $dayOfMonth, $year"; $txt -> insert('end', "Connection From: " ); $txt -> insert('end', $addr->peerhost() ); $txt -> insert('end', "\n" ); $txt -> insert('end', "$theTime \n" ); $txt -> insert('end',"Received: $_"); #The text that was receiv +ed print "Received: $_ \n"; print $addr $_; #print $path $_; #close $addr; chomp; #Not sure what this does print "Ready for next command....\n\n"; #Really don't need + this and don't want the black box showing . close $addr; # close client } }

In reply to Re^8: Server with GUI by gg4000
in thread Server with GUI by gg4000

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.