You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering an issue while trying to integrate the Rasta bridge into my Python code. Here's what I've observed:
Problem:
I have a Python server and client code that communicates successfully directly, using the rasta_pb2
and rasta_pb2_grpc generated by this .proto file provided in the repository.
However, when I attempt to use the Rasta bridge, the communication doesn't seem to work as expected.
I used the Getting started guide to setup everything
First of all, after the build i tested the rcat_tcp executable to verify if the build is working
Then i implemented server.py and client.py code and tested if its work directly Server.py:
importgrpcimporttimeimportconcurrent.futuresasfuturesimportrasta_pb2importrasta_pb2_grpcclassRastaServicer(rasta_pb2_grpc.RastaServicer):
defStream(self, request_iterator, context):
forreqinrequest_iterator:
# Echo the received message back to the clientyieldrasta_pb2.SciPacket(message=req.message)
defserve():
server=grpc.server(futures.ThreadPoolExecutor(max_workers=10))
rasta_pb2_grpc.add_RastaServicer_to_server(RastaServicer(), server)
server.add_insecure_port('[::]:50051')
server.start()
print("Server started. Listening on port 50051...")
try:
whileTrue:
time.sleep(86400)
exceptKeyboardInterrupt:
server.stop(0)
if__name__=='__main__':
serve()
I changed in the client.py code the port to 50052 and ran the program, after sending the text i receive this error from the client.py:
spadetsky@Pavlos-MBP Documents % python3 rastatest_client.py
Enter your messages (press Ctrl+D to finish):
Your message: 123
Traceback (most recent call last):
File "/Users/spadetsky/Documents/rastatest_client.py", line 20, in<module>run()
File "/Users/spadetsky/Documents/rastatest_client.py", line 13, in run
forrespin response:
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/grpc/_channel.py", line 542, in __next__
returnself._next()
^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/grpc/_channel.py", line 968, in _next
raise self
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:50052: Failed to connect to remote host: Connection refused"
debug_error_string = "UNKNOWN:Error received from peer {created_time:"2024-03-07T12:19:39.726899+01:00", grpc_status:14, grpc_message:"failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:50052: Failed to connect to remote host: Connection refused"}"
And after some time, the terminal with client bridge outputs this:
The socket could not be initialized: Too many open files
zsh: abort ./rasta_grpc_bridge_tcp rasta_client_local.cfg localhost:50051 127.0.0.1 8888
The .cfg files I used are the same as the ones i used for the rcat_tcp and I did not make any changes to them, they are the same as the .cfg files in the repository
I suspect that there might be something missing or incorrect in the way I'm running the Rasta bridge.
Could someone provide guidance on how to correctly set up and use the Rasta bridge with Python code?
Apologies if this is a basic question; I'm still learning and want to ensure I'm not missing any crucial steps.
The text was updated successfully, but these errors were encountered:
Probably your system limits the number of open file descriptors too much, so the Rasta bridge cannot open a socket (which is likely if you have lots of other processes running). Please check with ulimit -n and, if it's smaller than 1024, increase by running ulimit -n 1024.
Hi everyone,
I'm encountering an issue while trying to integrate the Rasta bridge into my Python code. Here's what I've observed:
Problem:
I have a Python server and client code that communicates successfully directly, using the rasta_pb2
and rasta_pb2_grpc generated by this .proto file provided in the repository.
However, when I attempt to use the Rasta bridge, the communication doesn't seem to work as expected.
I used the Getting started guide to setup everything
First of all, after the build i tested the rcat_tcp executable to verify if the build is working
Then i implemented server.py and client.py code and tested if its work directly
Server.py:
Client.py:
After the successful test i prepared these commands with these instructions to run the bridges:
For the server:
and the terminal output:
For the client:
and the terminal output:
[03/07/24|12:17:01 (Epoch time: 1709810221386)][DEBUG][RaSTA HANDLE_INIT] Loaded accepted version: 0303
I changed in the client.py code the port to 50052 and ran the program, after sending the text i receive this error from the client.py:
And after some time, the terminal with client bridge outputs this:
The .cfg files I used are the same as the ones i used for the rcat_tcp and I did not make any changes to them, they are the same as the .cfg files in the repository
I suspect that there might be something missing or incorrect in the way I'm running the Rasta bridge.
Could someone provide guidance on how to correctly set up and use the Rasta bridge with Python code?
Apologies if this is a basic question; I'm still learning and want to ensure I'm not missing any crucial steps.
The text was updated successfully, but these errors were encountered: