Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Changing the Port for sending
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Fabian Korak  
View profile  
 More options Jun 20 2012, 11:23 am
From: Fabian Korak <fabian...@googlemail.com>
Date: Wed, 20 Jun 2012 08:23:47 -0700 (PDT)
Local: Wed, Jun 20 2012 11:23 am
Subject: Changing the Port for sending

Hello, sorry for the double-post, google-mail interface decided to post
before I was finished...

I'm currently working on an implementation of the echo-algorithm in
Node.js. I currently have code like this(a lot snipped obviously):
*
Initial Node:
*var own_port = 33333;
var start_port = 22222;
var sendNode = net.connect(start_port,function(){    
            sendNode.write('info');
        })*
*//and typical listening code for listening on own_port
*Recieving Node:*
var own_port = 22222;
var back_port;

var nodeServer = net.createServer();
nodeServer.on('connection', function(client)
    {
    client.on('data',function(data)
    {
    back_port = client.remotePort;
    var sendNode = net.connect(back_port,function(){
                        client.write('info');
                    })

}

nodeServer.listen(own_port);

As some of you now may have noticed is that node does not send on the same
port it listens. Is there any way to specify over which port
'client.write()' sends, and if not, any alternatives or plans to add that?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Caswell  
View profile  
 More options Jun 20 2012, 11:47 am
From: Tim Caswell <t...@creationix.com>
Date: Wed, 20 Jun 2012 10:47:40 -0500
Local: Wed, Jun 20 2012 11:47 am
Subject: Re: [node-dev] Changing the Port for sending

Node supports duplex tcp streams just fine.  There is no need to have two
servers and two clients like in your example.

On Wed, Jun 20, 2012 at 10:23 AM, Fabian Korak <fabian...@googlemail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Fabian Korak  
View profile  
 More options Jun 20 2012, 1:00 pm
From: Fabian Korak <fabian...@googlemail.com>
Date: Wed, 20 Jun 2012 10:00:45 -0700 (PDT)
Local: Wed, Jun 20 2012 1:00 pm
Subject: Re: [node-dev] Changing the Port for sending

I was informed that I posted my problem on the wrong mailing list, so I
posted the topic again here:
https://groups.google.com/forum/?fromgroups#!topic/nodejs/YK5YAcIgu90

My last comment in that thread explains why I can't just use full duplex,
because I have to sent to multiple clients that only identified by their
ports.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »