Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Server listening on 2 differents ports

Reply
Thread Tools

Server listening on 2 differents ports

 
 
ssantamariagarcia@hotmail.com
Guest
Posts: n/a
 
      07-05-2005
I am trying to program a server in C for UNIX to get a kind of "bridge"
between the clients of a port A and the clients of a port B.
For that, I create 2 processes: one that listen the requests of port A
clients and another for the Port B ones.

In each process, when a connetion service is required, after accepting
, the value of the socket generated is added to a set of sockets. This
set keeps on listening on each socket for new messages to be read.

the question is that both processes get the same socket values, I
mean, the first client asking on port A get the same socket number that
the first one on port B. So I can not refer to a client in a unique way
, because there will be 2 clients with the same socket number .

I am using fork(), and in each process created, I use a method in
charge of creating the set of sockets and waiting for some event. I
suspect that the use of fork() is not right in this situation.........


In other words: If there is anybody who could know how to program a
server which is going to receive messages on 2 diferents ports and it
has to carry them from one port to another ( both ways), please, please
help me.


Thanks a lot !


(Sorry about my english)

 
Reply With Quote
 
 
 
 
ssantamariagarcia@hotmail.com
Guest
Posts: n/a
 
      07-05-2005
I' ll try there. Thanks a lot

Sonia

 
Reply With Quote
 
 
 
 
Lawrence Kirby
Guest
Posts: n/a
 
      07-05-2005
On Tue, 05 Jul 2005 04:16:27 -0700, ssantamariagarcia wrote:

> I am trying to program a server in C for UNIX to get a kind of "bridge"
> between the clients of a port A and the clients of a port B.
> For that, I create 2 processes: one that listen the requests of port A
> clients and another for the Port B ones.
>
> In each process, when a connetion service is required, after accepting
> , the value of the socket generated is added to a set of sockets. This
> set keeps on listening on each socket for new messages to be read.


Your question is about Unix and socket programming which are not covered
by the C language itself. A good newsgroup to ask your question is
comp.unix.programmer.

Lawrence

 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      07-05-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
>
> I am trying to program a server in C for UNIX to get a kind of
> "bridge" between the clients of a port A and the clients of a
> port B. For that, I create 2 processes: one that listen the
> requests of port A clients and another for the Port B ones.
>

.... snip ...
>
> (Sorry about my english)


Your English is satisfactory, your choice of newsgroups is not.
The C language knows nothing about ports, processes, clients,
forks, etc. You want a newsgroup that deals with those things.
Something with one of posix, linux, unix in its name seems
suitable.

Before posting there stop and read several days, or a weeks, worth
of postings. This should give you a strong feeling for whether or
not your query is topical. Read any welcome or FAQs associated
with the group.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AS5300s running telnet daemon listening on high unumbered ports J Cisco 2 01-18-2007 06:08 PM
Interruptions in live news listening Realone Player listening Thaqalain Computer Support 6 07-16-2005 02:11 PM
WEBrick listening on multiple ports? Lloyd Zusman Ruby 4 11-07-2004 08:35 AM
listening ports, newbie question Boris Cisco 0 01-08-2004 10:24 PM
Re: Listening ports?! R Green -WoWsat.com Computer Security 1 08-18-2003 06:54 AM



Advertisments