socket programing-problem with server


 
Thread Tools Search this Thread
Special Forums IP Networking socket programing-problem with server
# 1  
Old 08-06-2010
socket programing-problem with server

hi,
i am new to socket programming.i have a problem in server.requirement is it should continuosly read the requests from client(sends requests continuously) and after certain delay(i kept der sleep) should send response.

for this i used msgqueues so that after reading it is sending into que.here i started one thread to receive from que and send it to client.
Now, the problem is if i keep sleep() before while only for the first time it is waiting and after that continously sending...
if i keep sleep inside while it is receiving only one message at a time...
please help me in solving this...

Thanks in advance.
Regards,
chandini
# 2  
Old 08-07-2010
MySQL you need to change your server design

Hi chandinisree,
I think is better to setup a concurrent response socket server. This is a parent process creating a child process per client request. Then each child can sleep the time you need. See examples on concurrent socket response in a good book like "UNIX Network Programming" by Richard Stevens.

Hope this helps.

VicK
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Ubuntu

i have a problem in programing of linux

i have problem in running of Linux programing .can i run this programing in ubuntu. and what will be the procedure for that. please gave me a perfect suggestion.:wall: (8 Replies)
Discussion started by: g.gupta3392
8 Replies

2. IP Networking

Writing a Socket Server

Hi All I have to design a server socket program.The requirement is Each connection from client will be in different threads. The challenge is Suppose Server is now connected with two client Client A and client B.They will be in two different thread. My application requirement is when... (4 Replies)
Discussion started by: mr_deb
4 Replies

3. IP Networking

Help with Unix socket programing

hi I am strucked in a client server program client need to login to server client logins if only username and password are correct i have written a program username is stored as file and password is smilar to username whic is stored in that file when server asks for username... (2 Replies)
Discussion started by: karthik1238
2 Replies

4. Post Here to Contact Site Administrators and Moderators

socket programing-problem with server

hi, i am new to socket programming.i have a problem in server.requirement is it should continuosly read the requests from client(sends requests continuously) and after certain delay(i kept der sleep) should send response. for this i used msgqueues so that after reading it is sending into... (1 Reply)
Discussion started by: chandinisree
1 Replies

5. Programming

socket programing in client server

hei, i want to enter name and read it by client server socket program after checking name validity put the password and check.if ok than server clirnt say correct other wise incorrect. below my code: char name; printf ("Welcome to the server \n"); printf ("Enter user name: \n"); scanf... (1 Reply)
Discussion started by: saiful_911
1 Replies

6. Programming

how can I send and receive data in client server socket programing

char name; printf ("Welcome to the server \n"); printf ("Enter user name: \n"); scanf ("%c", &name); how can client send name to server:what should be the code? int send ( int sid , const char ∗buffer Ptr , int len , int f l a g ) how can client receive ack from... (1 Reply)
Discussion started by: saiful_911
1 Replies

7. Programming

Client/Server Socket Application - Preventing Client from quitting on server crash

Problem - Linux Client/Server Socket Application: Preventing Client from quitting on server crash Hi, I am writing a Linux socket Server and Client using TCP protocol on Ubuntu 9.04 x64. I am having problem trying to implement a scenario where the client should keep running even when the... (2 Replies)
Discussion started by: varun.nagpaal
2 Replies

8. UNIX for Advanced & Expert Users

connect problem for sctp socket (ipv6 socket) - Runtime fail Invalid Arguments

Hi, I was porting ipv4 application to ipv6; i was done with TCP transports. Now i am facing problem with SCTp transport at runtime. To test SCTP transport I am using following server and client socket programs. Server program runs fine, but client program fails giving Invalid Arguments for... (0 Replies)
Discussion started by: chandrutiptur
0 Replies

9. UNIX for Dummies Questions & Answers

open a socket on a server

Hello, I want to test a firewall rule between 2 servers A & B. I need a command that will open a socket on the server A such as: themagiccommand MyPort And on the client server B, i will run the command telnet IP_serverA Myport Can you help me ? Thank you Gunther (0 Replies)
Discussion started by: gunbol
0 Replies

10. Programming

creating GUI using C programing in unix server

I want to write GUI using C programing in Unix server. But I can not use windows.h header file. I want to create some text box using C programing. Please suggest me any sample code or tutorial for this purpose. I do not know any thing about GUI programing in C language. Thanks in... (5 Replies)
Discussion started by: rinku
5 Replies
Login or Register to Ask a Question