Skip to content Skip to sidebar Skip to footer

Script Breaks Out Of Function After Sending A Few Packets

I am writing a python program that sends packets for a specified amount of time. The sending script: import socket import time import networkparam import ray ray.init() transform

Solution 1:

ray.remote is a non-blocking operation. What's happening is your program is beginning the remote function call, then finishing. When it finishes, it tears down the ray cluster and ends the remote function.

You should add

s = send_message.remote()
ray.get(s)

The ray.get will try to get the return value of send_message (and return it), which means the program will have to wait for the remote function to finish.

Post a Comment for "Script Breaks Out Of Function After Sending A Few Packets"