socket.io is not a simple/regular TCP socket server.  If you want to 
connect with standard raw sockets (without implementing or using an entire 
WebSockets or HTTP library in your C++ application), just use 
require('net').createServer (low-level socket listening).

On Thursday, August 30, 2012 12:42:39 PM UTC-7, wes wrote:
>
> Hey. I realize this was years ago, but if this somehow reaches you... I 
> think I'm struggling with a similar issue and I would 
> really appreciate your help :)
>
> Just to clarify, you successfully got a c++ application to connect to your 
> node server using a regular old tcp connection, right?
>
> I'm trying to do that with a server that looks roughly like:
>
> var express = require('express');
> var app = express();
> var server = require('http').createServer(app)
> var io = require('socket.io').listen(server);
>
> app.use(express.cookieParser());
> app.use(express.session({
>   ...
> }));
> app.use(app.router);
>
> // response handling -------
> app.get('/', function(req, res){
>   console.log('request get /');
> });
>
> io.sockets.on('connection', function(socket) {
>   console.log('sockets.io connection!');
> });
> // -------
>
> port = 3000
> app.listen(port);
> console.log('Listening on port: ' + port);
>
>
> When I connect from my application all seems well (the connection 
> completes and I can send data without encountering any errors) but I never 
> trigger anything on the node server (io.sockets.on('connection' ...) is 
> never called and no errors are spit out).
>
> Do you see anything obviously wrong with my approach?
> Again, I really really appreciate any help you can give me!
>
> Cheers,
> -Wes
>
> On Monday, August 30, 2010 1:58:55 PM UTC-7, kmouja wrote:
>>
>> Hi all, 
>>
>> I'm new to node.js, I still managed to install it and run examples 
>> with socket.io. 
>>
>> I need to connect to node.js from a desktop c++ application. I tried 
>> to write a small socket client with a node.js socket server listening, 
>> but my client does not connect (connection timeout), and my server 
>> does not get a connection event... 
>>
>> I also write a php socket connection code and it won't connect either. 
>>
>> Is there something I am missing? node.js can connect to c++ socket, 
>> right? 
>>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to