LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   socket programming for server and multiple clients... (http://www.linuxquestions.org/questions/linux-networking-3/socket-programming-for-server-and-multiple-clients-825227/)

trinadh.cool 08-09-2010 11:45 PM

socket programming for server and multiple clients...
 
hii...
i want to know about the usage of select system call in sockets...
please help me in this..

thanks
trinadh...

er.surendersharma 08-09-2010 11:54 PM

Select () + Socket Programming
 
Quote:

Originally Posted by trinadh.cool (Post 4061307)
hii...
i want to know about the usage of select system call in sockets...
please help me in this..

thanks
trinadh...


With select(), instead of having a process for each request, there is usually only one process that "multi-plexes" all requests, servicing each request as much as it can.

So one main advantage of using select() is that your server will only require a single process to handle all requests. Thus, your server will not need shared memory or synchronization primitives for different 'tasks' to communicate.

One major disadvantage of using select(), is that your server cannot act like there's only one client, like with a fork()'ing solution. For example, with a fork()'ing solution, after the server fork()s, the child process works with the client as if there was only one client in the universe -- the child does not have to worry about new incoming connections or the existence of other sockets. With select(), the programming isn't as transparent.



Thanks
Er.Surender Sharma

er.surendersharma 08-09-2010 11:56 PM

Quote:

Originally Posted by trinadh.cool (Post 4061307)
hii...
i want to know about the usage of select system call in sockets...
please help me in this..

thanks
trinadh...

Hello Mr.

Use this link it will be more beneficial for u ..

http://www.lowtek.com/sockets/select.html

Thanks
Er.Surender Sharma


All times are GMT -5. The time now is 08:31 PM.