Is `SocketIO` and `HttpRequest` the same thing?

I remembered that socket is different from http request.
Out project need socket communication functions, but I review the SocketIO implementation of windows platform, I saw it implemented by HttpRequest. Windows API of socket communications are expected essentially, so it is really strange about that implementation.

So, is there any REAL socket communication implemented in cocos2d-x?

I use WebSocket for socket communication. Maybe you can try that too? There is an interface built in for cocos2d-X.

Except the ‘cpp-tests’, can you kindly show us some tutorials or web sites to get in to the state soon?

Sorry, I could not find any tutorial or website either, and got to figure it out myself too. But to help you, here’s a simplified Websocket example which I did myself, hopefully it will help you. It will connect to an echo server running Websocket protocol.

Classes.zip (3.9 KB)

The entire implementation of my server script as followed: (in python3)

import tornado.ioloop
import tornado.web
import tornado.websocket

clients = []

class WebSocketChatHandler(tornado.websocket.WebSocketHandler):
	def open(self, *args):
		print ("open", "WebSocketChatHandler")
		clients.append(self)
	
	def on_message(self, message):
		print(message)
		for client in clients:
			client.write_message(message)
			
	def on_close(self):
		clients.remove(self)
	
print ("Server is starting... ")	
app = tornado.web.Application([(r'/chat', WebSocketChatHandler)])

app.listen(8080)
tornado.ioloop.IOLoop.instance().start()

WebSocket are not pure Socket connection , it involve Http as start for checking if the other side support Socket
and then rount it to socket
for pure sucket you need lib like RakNet that now is free ( not L/GPL crap but free !! ) , its professional and used in many games :
http://www.jenkinssoftware.com/

Thanks for your hints, I’ll give it a try.