Raised This Month: $ Target: $400
 0% 

Sockets (Getting Time)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 04-05-2009 , 22:26   Re: Sockets (Getting Time)
Reply With Quote #1

Good to see you around again, Drak

1) First off in your request you should use '\r\n' instead of '\n' (not sure if this matters for Linux, I assume it does?).

Example:
Code:
GET /current_time_in_MV.aspx HTTP/1.1\r\n
Host: www.worldtimeserver.com\r\n
2) Now, you are also missing the connection parameter.

Example:
Code:
Connection: Close\r\n\
To tell the connection we are finished just send another new line '\r\n'.

So the complete example looks like this:
Code:
GET /current_time_in_MV.aspx HTTP/1.1\r\n
Host: www.worldtimeserver.com\r\n
Connection: Close\r\n\r\n
3) If you plug this into your code it should return the pages source. Now you have a problem because you need a buffer that can read ALL the html. I've never retrieved data with AMXX sockets before so I'm not sure if you can read the data in bursts or not.

4) Now you need to select the time out of all the html. It will probably be best to use regex for this.

Hopefully this can help you some

Last edited by hlstriker; 04-05-2009 at 22:34.
hlstriker is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:23.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode