CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Multiple TCPIP ports?!

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
stoyanoff



Joined: 20 Jul 2011
Posts: 375

View user's profile Send private message

Multiple TCPIP ports?!
PostPosted: Sat Jan 18, 2014 12:05 pm     Reply with quote

Greetings! Until now I've used ex13b.c to create a TCPIP programs. In this example the state machine is configured to use only 1 port. How could I modify it to work with more than one port ?!
Thanks!
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

Re: Multiple TCPIP ports?!
PostPosted: Wed Jan 22, 2014 11:55 am     Reply with quote

stoyanoff wrote:
Greetings! Until now I've used ex13b.c to create a TCPIP programs. In this example the state machine is configured to use only 1 port. How could I modify it to work with more than one port ?!
Thanks!



Why do you want more than one port?
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
stoyanoff



Joined: 20 Jul 2011
Posts: 375

View user's profile Send private message

PostPosted: Thu Jan 23, 2014 1:34 am     Reply with quote

For example, I want more than one user to be connected simultaniously!
Thanks!
Ttelmah



Joined: 11 Mar 2010
Posts: 19328

View user's profile Send private message

PostPosted: Thu Jan 23, 2014 8:21 am     Reply with quote

That doesn't involve multiple ports.

A 'connection' (socket) in a TCP/IP system, has source-IP, source-port, dest-IP, dest-port, and protocol components. Two systems can connect to the same port, because the source-IP differs, so a different socket is involved. Whether this is supported is down to whether the code is multi-threaded.

Best Wishes
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Fri Jan 24, 2014 10:25 pm     Reply with quote

Ttelmah wrote:
That doesn't involve multiple ports.

A 'connection' (socket) in a TCP/IP system, has source-IP, source-port, dest-IP, dest-port, and protocol components. Two systems can connect to the same port, because the source-IP differs, so a different socket is involved. Whether this is supported is down to whether the code is multi-threaded.



Doesn't need to be "multi-threaded" -- you just need to have enough handle slots in the stack to handle multiple socket opens to a given port number.

But otherwise, yea, 1 ethernet port with tcpip can definitely handle more than one user.

I used a PIC18F97J60 for an embedded webserver and it can handle 3 users (because that's all I wanted) simultaneously.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Ttelmah



Joined: 11 Mar 2010
Posts: 19328

View user's profile Send private message

PostPosted: Sat Jan 25, 2014 2:01 am     Reply with quote

Yes. You need a multi transaction handling on the stack, which in some environments is referred to as 'multi threading' here. Question of the term you use for the ability to be handling such transactions. Smile
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sat Jan 25, 2014 2:41 am     Reply with quote

Meh. It's a pretty sloppy use of the term.

MCHP's stack handles all sorts of things in a single "thread" that simply goes down the various stack calls to see if any data in/out needs to be serviced.

Only one thing happens at a time in sequential order.

It can't even be called time-slicing.

I think "multi-threaded" used in the case of a PIC is too far.
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Ttelmah



Joined: 11 Mar 2010
Posts: 19328

View user's profile Send private message

PostPosted: Sat Jan 25, 2014 2:59 am     Reply with quote

Agreed, but the question then becomes of what is generating the data for the transactions?. If you are doing something involving multiple users accessing different things, the code 'behind', feeding the stack, requires multiple threads.

Not a TCP/IP problem, but a question of how the data is generated.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group