The problem is the line: AdminFunctions::MainCall($clientHandle); I want to put the client in the module, so that part of the communication is in this case in the "AdminFunctions.pm". in the Module for example the MainCall Function is:while (($Timeout eq "false") && accept(Client, Server)) { #Server may run and a connection to a client has been found Messages::PrintToLog("Client Connected\n"); my $clientHandle = getpeername (Client) or print "Could not id +entify Client: $!\n"; my ($port, $iaddr) = unpack_sockaddr_in($clientHandle); my $clientIP = inet_ntoa($iaddr); Messages::PrintToLog("Client IP: $clientIP \n"); # Check which branch to go my $answer = <Client>; if ($answer eq "AdminUserLogin\n") { print Client "test"; AdminFunctions::MainCall($clientHandle); #$Timeout = "true"; } elsif($answer eq "ShutDown\n") { #DEBUG ONLY $Timeout = "true"; } Messages::PrintToLog("Got something from the Client: $answer") +; Messages::PrintToLog("Closing Client.\n"); close Client; } Messages::PrintToLog("Closing Server.\n"); close Server;
The program runs until it hits the line: "print $clientHandle" after that no error message is displayed and the program stops. How could i relaize this problem? What are my faults? I hope my english is not as bad as I think, its been a long time since I wrote a text in english (which is not my native language) regards Streen Edit: Repasted the code for better reading, sorry it was so unreadablesub MainCall { $ClientHandle = shift @_; Messages::PrintToLog("Admin: MainCall"); print $ClientHandle "Testing"; my $Answer = <$ClientHandle>; #some more function calls }
In reply to Socket Client to Module by Streen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |