[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 448
  • Last Modified:

how do I impliment my tcp client server programing asynchronous

Hi,

I have implement tcp client/server programming which is synchronous i.e. when a request come, it serves that request the goes to others request. Now I want to incorporate a feature that will make my program asynchronous.. i.e., when a request from client is served.. then server goes to listen mode to accept another connection from client...

pls help me as soon as possible..
0
arijit_rebaca
Asked:
arijit_rebaca
  • 4
  • 3
1 Solution
 
manish_regmiCommented:
Hi,
  Richard Stevens book contains a very good description on that subject. Please consider buying one if you are into network programming.

1) use select and poll
2) use O_NONBLOCK on socket descriptors.

description here:
http://squirl.nightmare.com/medusa/async_sockets.html

regards
Manish regmi
0
 
arijit_rebacaAuthor Commented:
at present I have no Richard Stevens book .... So pls depict an example using select() and poll()

as soon as possible
0
 
manish_regmiCommented:
download sample codes for Stevens book from here
http://www.kohala.com/start/unpv12e.html

it is unv12e.tar.gz

unzip and see the advio folder for asynchronous io codes.

You can ask if you don't understand anything.

regards
Manish Regmi

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
arijit_rebacaAuthor Commented:
it can't gunzip under linux.. using

gunzip unv12e.tar.gz

it gives unexpected end of file
0
 
manish_regmiCommented:
may be download is corrupted. Its working fine for me.

try downloading again

try using
tar xzf filename

regards
Manish Regmi


0
 
arijit_rebacaAuthor Commented:
ya got it...

but there are so many folder and file.... where I should look in... pls tell me... the required folder and file for select and poll code

0
 
manish_regmiCommented:
advio folder

Here is some info on poll and select:
http://builder.com.com/5100-6372-1044098.html

regards
Manish Regmi
0
 
Razor2k5Commented:
As network programming is based on 2 concepts : connection oriented TCP or connection less UDP

So the server can be concurent or iterative. The protocol that you use it's up to you to implement. So you can create a heap or a list based on priority.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now