<HTML><FONT FACE=arial,helvetica><FONT SIZE=2 FAMILY="SANSSERIF" FACE="Arial" LANG="0">1. How well does MC handle multiple connections at once ('concurrency')?</FONT><FONT COLOR="#000000" style="BACKGROUND-COLOR: #ffffff" SIZE=2 FAMILY="SANSSERIF" FACE="Arial" LANG="0"></BLOCKQUOTE><BR>
<BR>
</FONT><FONT COLOR="#000000" style="BACKGROUND-COLOR: #ffffff" SIZE=2 FAMILY="SANSSERIF" FACE="Arial" LANG="0">There are a few issues here. First off, Metacard basically handles one connection at a time; however, there are several ways to work with this. First, when reading/writing to sockets, you can use asynchronous calls which will allow other connections to come in. The pitfall here is that while a handler is executing, no others will. So its possible to have more than one connection get in, but they are basically processed one at a time if they are calculation-intensive. If most of the work *is* the data transer, you'll be able to handle a few connections at a time, maybe even many.<BR>
<BR>
If you truly want "multiple connections", you can run multiple processes. This is really only sane if you are using one of the UNIX engines (or Darwin under MacOS). With such an engine, you can spawn many processes running on separate ports which will behave nicely in serving many requests. This is a memory hog with non-UNIX builds (i.e. GUI apps). If you search the archives, I posted some code using "open process" under the Darwin engine for this in the last month.<BR>
</FONT><FONT COLOR="#000000" style="BACKGROUND-COLOR: #ffffff" SIZE=2 FAMILY="SANSSERIF" FACE="Arial" LANG="0"><BR>
</FONT><FONT COLOR="#000000" style="BACKGROUND-COLOR: #ffffff" SIZE=2 FAMILY="SANSSERIF" FACE="Arial" LANG="0"><BR>
<BLOCKQUOTE TYPE=CITE style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">2. Better of using shared or multiple ports?</BLOCKQUOTE><BR>
<BR>
Myself, I haven't found a way to have multiple processes share the same port. It is most likely possible if you can work at a lower level (i.e. embedded MetaCard); but scripted socket support won't let you listen on the same port twice. So, if you want one port you are probably stuck with one process. Unless you are using multiple processes, I don't see much advantage to multiple ports- although it could have marginal benefits. I think the possible confusion added would be more than its worth.<BR>
<BR>
HTH,<BR>
Brian<BR>
</FONT></HTML>