logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) Basic webserver for alive check (Read 1187 times)
medor
Full Member
***
Offline


Oldunreal member

Posts: 249
Joined: May 17th, 2009
Re: Basic webserver for alive check
Reply #15 - Jun 23rd, 2017 at 8:29pm
Print Post  
  
Back to top
 
IP Logged
 
x21
Betatester
Offline



Posts: 51
Joined: Mar 30th, 2017
Gender: Male
Re: Basic webserver for alive check
Reply #16 - Jun 23rd, 2017 at 8:38pm
Print Post  
BobIsUnreal wrote on May 23rd, 2017 at 2:38am:
Python script. Meant to work only on linux.

Code
Select All
#!/usr/bin/env python

import socket
import time
import psutil #sudo apt-get install python-psutil

PROCNAME = "UCCLinux.bin"
IP = "127.0.0.1"

PORT = 1888


sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
sock.settimeout(30)
sock.bind((IP,PORT-1))

counter = 0

while True:
        sock.sendto(":|",(IP,PORT))
        try:
                data, addr = sock.recvfrom(1024)
                counter = 0
                time.sleep(1)
        except socket.timeout:
                counter = counter + 1
                print "Counter = " + str(counter)
                if counter >= 10:
                        print "Ok attempting to kill..."
                        for proc in psutil.process_iter():
                                if proc.name( == PROCNAME:
                                        print proc.name( + "getting killed!!!"
                                        proc.kill()
                        counter = 0 




I was thinking of doing something like this using win32serviceutil in Windows and this tool called nssm that allows ucc to run as a windows service.

https://nssm.cc/

=================================================

medor wrote on Jun 23rd, 2017 at 8:29pm:


These are all linux scripts except for the telnet server.
  
Back to top
 
IP Logged
 
x21
Betatester
Offline



Posts: 51
Joined: Mar 30th, 2017
Gender: Male
Re: Basic webserver for alive check
Reply #17 - Oct 13th, 2017 at 8:42pm
Print Post  
BobIsUnreal wrote on May 23rd, 2017 at 2:38am:
Code (C++)
Select All
class watchdog extends udplink
        transient;

function PostBeginPlay()
{
        linkmode = MODE_TEXT;
        bindport(1888,false);
}

event ReceivedText( IpAddr Addr, string Text )
{
        SendText(Addr,Text); //Just echo it back.
} 




Do you think this can be ran using TCPLink instead of UDPLink? If so this can be implemented quite easily with something like this https://www.microsoft.com/en-us/download/details.aspx?id=17148
  
Back to top
 
IP Logged
 
[]KAOS[]Casey
Developer Team
Betatester
Offline


nedm

Posts: 3077
Joined: Aug 7th, 2011
Gender: Male
Re: Basic webserver for alive check
Reply #18 - Oct 25th, 2017 at 4:03am
Print Post  
Late, but there is no specific reason why it TCP link couldn't be used.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo