mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Added a sample python file to interact with the BYOND socket interface.
This commit is contained in:
14
DLLSocket/server_controller.py
Normal file
14
DLLSocket/server_controller.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import SocketServer
|
||||
|
||||
class UDPHandler(SocketServer.BaseRequestHandler):
|
||||
def handle(self):
|
||||
data = self.request[0].strip()
|
||||
socket = self.request[1]
|
||||
print "{} wrote:".format(self.client_address[0])
|
||||
print data
|
||||
socket.sendto(data.upper(), self.client_address)
|
||||
|
||||
if __name__ == "__main__":
|
||||
HOST, PORT = "localhost", 8019
|
||||
server = SocketServer.UDPServer((HOST, PORT), UDPHandler)
|
||||
server.serve_forever()
|
||||
Reference in New Issue
Block a user