View previous topic :: View next topic |
Author |
Message |
stoyanoff
Joined: 20 Jul 2011 Posts: 375
|
Multiple TCPIP ports?! |
Posted: Sat Jan 18, 2014 12:05 pm |
|
|
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: 1615 Location: Central Illinois, USA
|
Re: Multiple TCPIP ports?! |
Posted: Wed Jan 22, 2014 11:55 am |
|
|
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
|
|
Posted: Thu Jan 23, 2014 1:34 am |
|
|
For example, I want more than one user to be connected simultaniously!
Thanks! |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Thu Jan 23, 2014 8:21 am |
|
|
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: 1615 Location: Central Illinois, USA
|
|
Posted: Fri Jan 24, 2014 10:25 pm |
|
|
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: 19513
|
|
Posted: Sat Jan 25, 2014 2:01 am |
|
|
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. |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Sat Jan 25, 2014 2:41 am |
|
|
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: 19513
|
|
Posted: Sat Jan 25, 2014 2:59 am |
|
|
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. |
|
|
|