I am building web application that must contact another application using socket connections. This really is new territory for me personally, so want to be certain that electrical sockets will vary than websockets. It appears like they are only conceptually similar.
Asking because initially I'd planned on using Django because the foundation for my project, however in the SO publish I associated with above it's made very obvious that websockets aren't possible (or at best not reliable, despite something similar to django-websockets) while using preferred Django setup (Apache with mod_wsgi). Yet I have found other posts that delicately import Python's socket module for simple things like getting the server's hostname.
So: a) Could they be really different?
And b) Can there be any reason to not use Django for any project that depends on establish socket connections by having an outdoors server?
To reply to the questions you have.
- Despite the fact that they achieve (generally) similar things, yes, they are really different. WebSockets only run from browsers hooking up to Application Server on the protocol much like HTTP that runs over TCP/IP. So that they are mainly for Web Programs that need a lasting link with its server. However, plain electrical sockets tend to be more effective and generic. They go beyond TCP/IP but they're not limited to browsers or HTTP protocol. They may be accustomed to implement any type of communication.
- No. There's pointless.
You'd need to use WebSockets (or some similar protocol module e.g. as based on the Expensive wordpress plugin) just because a normal browser application simply can't open a pure TCP socket.
It's really a far more generic communications module that may run on the top of many other network methods, including WebSockets, and Expensive electrical sockets.
Hence if you wish to use
Socket.IO around the server finish you have to also employ their client code and objects. You cannot easily make raw
WebSocket connections to some
socket.io server as you'd need to emulate their message protocol.
Relating to your question (b), remember that the Websocket specs has not been completed. Based on the W3C:
Implementors must be aware this specs isn't stable.
Personally I regard Websockets to become waaay too bleeding edge to make use of at the moment. Though I'll most likely locate them helpful each year approximately.
Websockets use electrical sockets within their implementation. Websockets derive from a typical protocol (now in final call, but not final) that defines an association "handshake" and message "frame." The 2 sides feel the handshake procedure to mutually pay a connection after which make use of the standard message format ("frame") to pass through messages backwards and forwards.
I am creating a framework that will help you to communicate directly machine to machine with installed software. It could fit your purpose. You are able to follow my blog if you want: http://highlevellogic.blogspot.com/2011/09/websocket-server-demonstration_26.html