Ok, so i'm working on this server program, and I want to tell my client that its the last data packet that i'm sending by passing the FIN flag WITH the data.

DATA + FIN, PSH, ACK -> Client
ACK -> Server
FIN, ACK -> Server
ACK -> Client


Thats how I want it to close. But when I send my data packet its only PSH,ACK and the client just ack's waiting for more. Remeber, I want the FIN and the data to go at once. Is there a way to manually set this flag??? TIA.