[En-Nut-Discussion] More clients on the same TCP port

def at fea.kiev.ua def at fea.kiev.ua
Fri Sep 29 11:05:54 CEST 2006


> Hello
>
> ZIP wrote:
>> Hello,
>>
>>  Could you please give me a hint how to implement a server, which serves
>> on the same port for more ethernet clients.
>
> From
> http://www.ethernut.de/api/index.html
>
> ************************
> The order of API calls for TCP servers is
>
>      * NutTcpCreateSocket()
>      * NutTcpAccept()
>      * NutTcpSend(), NutTcpReceive()
>      * NutTcpCloseSocket()
>
> Note, that this differs slightly from the Berkley API, where the initial
> socket is bound to a port and an additional socket is created when a
> connection is accepted. Nut/Net doesn't provide a bind call.
> *************************
>
> As far as I understand this, once a server socker accepts one incoming
> connection you cannot use that socket to listen for more incoming
> connections. But I am not an expert here.
>>
>> Is it possible to have NutTcpAccept on created socket at the beggining
>> of a thread a then starts new thread for this socket, which receives
>> text commands and proceeds them and may-be send replies ?
>
> I think so, as long as you are able to make the socket visible to the
> new thread. However, as I told you before, I think that that socket will
> not accept any other incoming connection, no matter what thread you are
> using it from.
>
> Please, some guru correct me...
>>
>> I need to accept more connections before all the commands are proceeded.
>
> I would use different ports. I ignore other solution here.
>
Hmmm....
nutapp/httpd ????
>>
>> Best Regards
>>
>> Petr
>
> Regards,
> José
>
>
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>




More information about the En-Nut-Discussion mailing list