Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Please help me



Hello,

There is one problem in listening for multiple simultaneous
connections.

i am developing a Server application which keeps on listening
for connections. whenever a connection comes i create a different endpoint
and pass that endpoint to a thread. That particular thread will take care
the rest of the communication with connection. Main thread will listen for
other connections. (note: all my endpoints are in asynchronous mode)

my problem is when the very first connection comes it creates an endpoint
and accepts the connection. now the endpoint will be in a proper state. ie
T_DATAXFER state. The listening endpoint will call its callback function
with the code T_ACCEPTCOMPLETE. The other endpoint will call its notifier
function with the code T_PASSCON.
but when the second connection comes after the execution of the OTAccept
call, listening endpoint will call the notifier with T_ACCEPTCOMPLETE but
the other endpoint does not call its notifier leaving the endpoint in
T_UNBND state.

can anybody help me in solving my problem..?

the easiest way how to serialize incoming connection requests is to use tilisten module. Use OTCreateConfiguration("tilisten,tcp") or what are you using. This is ALL you have to do. For more information about tilisten module look at OT book.
I have written simple asynchronous HTTP server with tilisten and I had no such problem.

-Tomas
--
# Tomas Zahradnicky, Jr
# The Czech Technical University
# FEL-CTU, Prague


References: 
 >Please help me (From: Prashanth Shenoy <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.