How can I fimd the port number address for my service?

201 Views Asked by At

I want to create streaming videos by using a socket. I need to know how I can find the port number address.

My code that I wrote to create a client:

# create socket
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host_ip = '192.168.0.165'  # paste your server ip address here
port = 
client_socket.connect((host_ip, port))  # a tuple
data = b""
payload_size = struct.calcsize("Q") # Q: unsigned long long integer(8 bytes)
1

There are 1 best solutions below

0
On

Can you post the code from your service app? (or name the service app) Usually you declare the port in the service somewhere. If its prebuilt, it could be in a configuration file.

You can run cmd.exe and type netstat to check your port activity. Or go to your firewalls inbound/outbound rules. Typically if its a prebuilt app it will create a firewall rule with associated port so the firewall does not freak out when connections come in to that port.

But otherwise there is not enough information here for me to give a complete answer.