![]() |
| | #1 |
| Registered User Join Date: Dec 2006
Posts: 19
| Send ACK message I have an assignment where I shall communicate with a server and send messages between client and server. The text says that when a message has been received, the server shall answer with an ACK. I really don't understand what an ACK means and how to send one. I have searched on google and some books but haven't found an answer. Can anyone help me out and point me in the right direction. We're using Berkley sockets and communicating through TCP on Linux. dagH |
| daghenningsorbo is offline | |
| | #2 |
| Registered User Join Date: Jun 2008
Posts: 1,134
| TCP where you can find about ACK (acknwoledgement). I would think that all this stuff is done automatically for you. You call a function Send() and it waits until the message is sent. It retries until this happens. It is notified when it does, meaning no need to actually sent anything else (as a programmer). Except if you are using something really low-level and you need to do anything manually. |
| C_ntua is offline | |
| | #3 |
| Registered User Join Date: Dec 2006
Posts: 19
| Yes I have understood the meaning of ACK in a TCP packet, but in the assignment I'm gonna send a message from server, then when the message is received on the client, I'm gonna send an ACK back to the server to confirm that the message really was received. Does anyone know to do that? |
| daghenningsorbo is offline | |
| | #4 |
| subminimalist Join Date: Jul 2008 Location: NYC
Posts: 3,944
| Well, ACK is a standard http message. It is just literally: Code: char ack_msg[]="ACK" Of course, if you are doing all that you may also have to include a HTTP header with each message (presuming your server is supposed to operate in accord with the http protocols). Contrary to C_ntua's contention, ACK is not part of the TCP protocol. You obviously do not need to worry about the tcp/ip details if you are using a C socket networking API. The TCP/IP stuff is done for you yes -- but it does not do http negotiation, you have to code that yourself.
__________________ Accuracy and integrity mean nothing if you don't make it past the censors...PYTHAGORAS Last edited by MK27; 11-07-2009 at 10:27 AM. |
| MK27 is offline | |
| | #5 |
| Registered User Join Date: Aug 2005
Posts: 1,303
| Many protocols use the character value 0x06 for ACKnowledgement. Kurt |
| ZuK is offline | |
| | #6 |
| Registered User Join Date: Dec 2006
Posts: 19
| Well, I'm not doing anything related to the http protocol. We are supposed to create our own application layer protocol to handle the messages. The messages sent from client to server is just raw text. I think what I'm really asking for is if ACK is a special message (with a specified format)? Of course I can make some formatting to my messages and then define an ACK-message, but that's all about what I do with the data being sent. So is ACK a special type of message with a defined format? |
| daghenningsorbo is offline | |
| | #7 | |
| subminimalist Join Date: Jul 2008 Location: NYC
Posts: 3,944
| Quote:
On the other hand, since an ACK will not have any further content, you could make it more elaborate to prevent confusion: Code: #define ACK "<!Recieved!>"
__________________ Accuracy and integrity mean nothing if you don't make it past the censors...PYTHAGORAS | |
| MK27 is offline | |
| | #8 |
| Registered User Join Date: Dec 2006
Posts: 19
| Thank you for your answer. That cleared things up for me. |
| daghenningsorbo is offline | |
![]() |
| Tags |
| ack, tcp |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Desperate Over Ecs! | cookie | C Programming | 17 | 07-16-2008 01:25 PM |
| sending n no of char data uning send() function, | thebrighter | Windows Programming | 1 | 08-22-2007 12:26 PM |
| Message class ** Need help befor 12am tonight** | TransformedBG | C++ Programming | 1 | 11-29-2006 11:03 PM |
| Making a script language? | Blackroot | Game Programming | 10 | 02-16-2006 02:22 AM |
| Sending CChildView a Message :: MFC | kuphryn | Windows Programming | 0 | 04-06-2002 03:00 PM |