?
Solved

the terminology of Socket  and Websocket on php apache

Posted on 2014-09-03
6
Medium Priority
?
583 Views
Last Modified: 2014-09-03
Dear Experts,

Just want to clarify my concept to some terminology on reading articles.As I know socket is connection and communication between client and server-side that we learnt it before on classical C . On php, there is also socket example such as on the socket tutorial link at http://php.net/manual/en/sockets.examples.php

Question-1, all php apache server TCP/IP are implemented by using exact socket function described on the previous link , and the  TCP/IP are including http,stmp, ftp,.....telent ..etc.Is it correct ?

Question-2 Websocket is another type of socket that is different from the socket function above, right? It aims to serve for web application such as chat/Game application since needs to bulid persistant connection. Is it correct ? The persisant connection means forever-active connection
that is NOT the same socket connection which is one-time process (create->connect->disconnect->done getting http pages). Is it right  ?

Question-3 I found one apache websocket at https://github.com/disconnect/apache-websocket.
People created that apache websocket code because classical  php apache doesn't have websocket function idea before so that it aims to create it  for the web application(Game and chat app) for old version php apache server. (Probably If the answer to question-2 above is correct, it imply this question-3 answer is also correct)

Please advise

Rwniceing
0
Comment
Question by:rwniceing
  • 3
  • 3
6 Comments
 
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 2000 total points
ID: 40300414
Answer 1.  PHP sockets don't necessarily have anything to do with Apache.  The sockets themselves are part of the networking software in the operating system.  While basic protocols like HTTP and SMTP are not too hard, FTP gets more difficult because it requires a pair of sockets on different ports and it has a lot of overhead.  Protocols like HTTPS and SSH are probably pretty difficult to use because of the overhead for encrypting and decrypting the data.  Programs that use those protocols are usually written in C and compiled so they have less overhead than an interpreted language like PHP.

Answer 2+3.  'Websocket' is a specific application of sockets.  In the Apache article, it refers to WebSocket protocol (RFC 6455).  Like I said above, sockets are part of the networking software in the operating system.  http://en.wikipedia.org/wiki/WebSocket
0
 
LVL 1

Author Comment

by:rwniceing
ID: 40300421
so,

Answer -1 all TCP/IP are implemented on socket software function in C. PHP socket just provide similar method interpreted by php script which  aims that is convenient for php users for developing  their TCP/IP application.

and my concept to websocket on qeustion-2 and 3 is NOT correct ? and I'm NOT asking what the websocket  spec is  . Please advise kindly
0
 
LVL 1

Author Comment

by:rwniceing
ID: 40300442
After reading your attached link,

Socket is software and implement TCP/IP protocol described at wiki at http://en.wikipedia.org/wiki/Network_socket
Websocket is other protocol from classical TCP/IP protocol, and it aim to more on long-live-connection or persistant connection application such as chat/game application. And other important usage is also described on wiki link.

For question-2 and question-3, the answer is "yes" or more or less  similar to the writing just right above . Apache websocket is also software and implement websocket protocol for HTTP between browser and server application or communication

Dave Baldwin, if you agree it, I will close this thread
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 40300472
Yep, that's pretty much it.  Sockets are at a very low level and require a lot of work to use them.
0
 
LVL 1

Author Closing Comment

by:rwniceing
ID: 40300476
Thanks for your reply
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 40300509
You're welcome, thanks for the points.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains the fundamentals of industrial networking which ultimately is the backbone network which is providing communications for process devices like robots and other not so interesting stuff.
Tech spooks aren't just for those who are tech savvy, it also happens to those of us running a business. Check out the top tech spooks for business owners.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question