Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » How to close the websocket connection
Re: How to close the websocket connection [message #49555 is a reply to message #49554] Wed, 28 February 2018 23:27 Go to previous messageGo to previous message
Klugier is currently offline  Klugier
Messages: 1076
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Mirek,

Why not to keep request_headers as Vector:
Vector<String> request_headers;

request_headers = { 
    "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"",
    "Accept-Language: cs,en-US;q=0.7,en;q=0.3",
    ...
};

// The user can add custom headers to the vector with more straight forward wait. Moreover user will not be obligated to remember about /r/n.
auto header = web_socket.StandardHeaders();
header.Add("Custom-header: data");

// Deletation is also trivial of any of the standard headers.
request_headers.Remove(1); // Remove ""Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"",", I don't need it!

// The set method also needs to be change
web_socket.RequestHeaders(request_headers);



\r\n can be added to the lines while processing. These approch is more flexible than String implementatino. Please let me know what do you think?

Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Wed, 28 February 2018 23:40]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Vector<Vector<double>>
Next Topic: how to convert unicode to String
Goto Forum:
  


Current Time: Tue May 07 05:35:12 CEST 2024

Total time taken to generate the page: 0.02194 seconds