简体   繁体   中英

Socket programming python on real server

I'm following this http://www.raywenderlich.com/3932 for socket programming in iOS where the server coding is in PYTHON , however, I just want to know that according to this tutorial, the author used localhost and run the code from terminal such that python server.py to execute and listen for socket.

What I'm confusing is that, how can I make this command on real server, such that after putting the code of python in CGI-BIN , how can I run that from shell/terminal of a shared web hosting.

Here's my SSH Screenshot, where I tried to run that command to bind and listen for socket, but Here i'm failed as no JAVA LOGIN section is appearing in my case as the video tutorial shows.

我的SSH

My Question is, How can I run the command so that the server will listen for the port, as on my localhost.

The command is: python server.py

On a shared web hosting server you probably have a running web server for which you write scripts which generate some output for the web server to return to the client.

server.py however is no such script. It contains the code for an actual server. Running the command starts the server. Therefore you won't get this working by simply putting the file in a CGI-BIN folder. You do need to run the command.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM