473,405 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How to send a response to one of the user between the two?

Dear sir.
The project is related to the iphone application. and i am working at server side. The language used is PHP. About the application: It is a game that will be played at the server side. It is like teen patte. one user have three cards and he will play with another user that also have three different cards. the player that have the higher preference card will win the game.
Think myself as a server and you are the one player and the other player is Amit. now you see Amit is online and try to ping him. the request comes to me and i have to send a message to Amit that You wants to play with Him. How can i do this?

user1-------> Server------------------> user2

user1 click on user2 that is in online list. I will only get the id of both of the users. how can i make communication b/w both of the users.


Witing For reply.
Thank you in advance
Mar 2 '11 #1
3 1407
dlite922
1,584 Expert 1GB
Stateless Servers don't communicate with clients, rather the clients "ping" the server.

Your map should look like this:

John -----------> Server <------- Kim

1. John sends invite to Kim
2. Server stores the request in an invite table
3. Kim every x seconds asks the server if there is invites for me. Server comes back with a list, in this case Kim will see there's an open invite from John.

The rest of the game is played exactly the same way with both users updating the server's data.

Hope that helps,


Dan
Mar 2 '11 #2
HaLo2FrEeEk
404 256MB
The real fun comes in deciding how to balance your ping rate and server load. You could ping the server for new invites a few times a second. The erver would be under strain, but the end user will recieve updates more quickly. On the other hand, you could only ping the server once every 2 seconds. In this case the server won't stress as much, but the user will have to wait longer for updates. The key is finding a good balance.

Of, and you'll probably want to use AJAX.
Mar 4 '11 #3
Thanks a lot sir. You help me a lot........................................
Mar 8 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Derek Fountain | last post by:
I need to create a data file from my PHP for the user to load into their word processor as a mail merge data source. Organising the data into rows of comma separated values isn't too difficult;...
0
by: zhimin | last post by:
Hi, I'm writing a program to send large file(100m) through dotnet using TCPListener & TCPClient, I'm sending the file with a ask and response loop: 1. Client send a flag 1 to server indicate it...
2
by: Nathan Sokalski | last post by:
I am using the Response.Redirect method in a User Control to allow visitors to click an ImageButton to take them to another page. However, when I click the ImageButton I recieve the following...
17
by: Dave | last post by:
I'm using VB.NET 2003. I can send a user back one page with this command: Response.Redirect(Request.ServerVariables("HTTP_REFERER"). Is there a simple way to send him back two pages? ...
1
by: Lizz | last post by:
I have a page which i need sent via email when user hits submit button here is an example of the CDo code i'm using which is not working. Please help <% Dim objMessage Set objMessage =...
5
by: Marina | last post by:
What is the right way to go about making sure an application is not frozen and unresponsive while a relatively long running process is going on? The process is making updates to the UI, which the...
3
by: Klaus Jensen | last post by:
For a customer I have created a website, where we use dynamic url-rewrites by using rewritepath in global.asa. Ie the url /products/gizmo.aspx does not really exist, but I look gizmo up in the...
0
by: Daniel Di Vita | last post by:
I have three separate applications setup on an IIS server. Let’s call them AppA, AppB, and AppC. On AppA (the Default application) the user is presented with a login window. The login information...
3
by: jp2code | last post by:
Does the .Send method return anything from CDOSYS? Ex: Dim result Set oMail = CreateObject("CDO.Message") ' other code result = oMail.Send I've tried searching, but I can't find where...
2
by: kennykenn | last post by:
Hi, Ive producd code to send an email after capturing info off a form,it works fine locally but when i put it live it doesnt work! the code is stopin at 'msg.send' any ideas, here the code! ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.