socket recv hangs forever or timeout - python

I'm using rpyc package to communicate between server and client. Everything was worked fine until today. My client pc can't receive message from server. So I run socket server:
$ python bin/rpyc_classic.py
INFO:SLAVE/18812:server started on [0.0.0.0]:18812
Connect like in docs:
import rpyc
conn = rpyc.classic.connect("10.99.100.200")
I tried to debug with wireshark, firewall is off and all is worked before. I'm using OSX. When I do reverse, connection working fine

Related

Client can't connect to websocket server using servers ip

I'm building a home automation project, I have a websocket server I've built with pythons websocket and asyncio libraries. When I use a python client testing script and use local host to connect, it works perfectly. However, when I use my computers IPv4 address it doesn't. I've tried connecting using esp's, raspberry pi's and the same testing script on the same computer. Any idea's?

Ngrok as portforwarding in python socket not connecting

I have a problem where the socket client wont connect to the server in python when using ngrok. Only if i run the server before starting the client it works. Also the client wont detect when server looses connection anymore. I think the client detects ngrok as a server without the python server running

Python rpyc run in background

I am using rpyc to create a Service (server). I was able to do this. Now I'm I would like to run it and connect to it using my client.
I run the server
python3 myserver.py
This runs fine. Then I run the client
python3 myclient.py
The problem is I get an error:
ConnectionRefusedError: [Errno 61] Connection refused
When I run myserver.py from Anaconda Spyder, them my client works fine, but when I run my server from the shell or command prompt, it says connection refused. Is there a specific way I need to run a rpyc server in order to connect to it?
First, check your firewall - is it open for RPyC server port
Also make sure your server uses for binding address 0.0.0.0 and not localhost (127.0.0.1)
Very important to ensure that both server and client use the same Python and RPyC versions

Problems with connecting to my python chat-app server

I am new to python socket programming and was following a tutorial building a chat-app, using kivy and sockets. I am running my server on my main PC and I was trying to connect from my laptop to this Server, but it doesn't work (Both my PC and laptop are connected via Ethernet cable). When I run the client.py on the PC that I host my Server on, everything works fine.
I tried running the Server on my 0.0.0.0 address and then connecting from my laptop to the IP address that appears on my Server PC if I type in "ipconfig" (192.168.2.x) but it didn't work. I also tried running the server just on the Ethernet-Adapter IP that appears when I type in "ipconfig" (so 192.168.2.x) but this doesn't work neither.
Lastly I have tried defining my Server IP by using the built in socket function: socket.gethostbyname(socket.gethostname()) (weirdly when I run this, my Server runs on my VMware Network Adapter (192.168.66.x) instead of my Ethernet-Adapter). But this too didn't work :(
The client.py code on my laptop always returns this error:
connection error: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Would appreciate any help :)
edit: Could this have something to do with the firewall on my PC blocking connections or something?
Found the Problem! Today it actually worked by disabling my host PCs Windows Defender internal Firewall and the running the Server on 0.0.0.0, which is very weird because yesterday it didn't work...

websocket connection goes to unknown state

I have a web server running on ubuntu instance at Amazon EC2.
My web server is written in Python and supports WebSockets.
My Problem:
I am able to connect to my server through websocket and I am also able send and receive data over websocket. However, after few minutes if I try to send data on same connection from client application I am not receiving anything on server for the same established connection. Now if I close the client application or try to connect through another client application, I am able to connect and communicate again for few minutes only. And after few minutes the new connection again faces the same issue. Please help me to solve the issue.
Of course, when I run the server on my local testing environment the connection never dies and I can communicate over same websocket connection after hours also.

Categories