mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-13 06:12:49 -06:00
.upptst
git-svn-id: svn://ultimatepp.org/upp/trunk@6659 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
6986e7917f
commit
01613e65fb
3 changed files with 46 additions and 0 deletions
31
upptst/Socket/Socket.cpp
Normal file
31
upptst/Socket/Socket.cpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
StdLogSetup(LOG_COUT|LOG_FILE);
|
||||
|
||||
TcpSocket socket;
|
||||
|
||||
if(!socket.Connect("pop.gmail.com", 995)) {
|
||||
LOG("Socket error encountered: " << socket.GetErrorDesc());
|
||||
Exit(1);
|
||||
}
|
||||
if(!socket.StartSSL()) {
|
||||
LOG("Couldn't start SSL session.");
|
||||
Exit(1);
|
||||
}
|
||||
|
||||
// 5 secs.
|
||||
socket.Timeout(5000);
|
||||
|
||||
String server_hello = socket.GetLine();
|
||||
|
||||
DUMP(server_hello);
|
||||
DUMPHEX(server_hello);
|
||||
|
||||
ASSERT(server_hello.StartsWith("+OK Gpop ready for requests from"));
|
||||
|
||||
LOG("=========== OK");
|
||||
}
|
||||
10
upptst/Socket/Socket.upp
Normal file
10
upptst/Socket/Socket.upp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
uses
|
||||
Core,
|
||||
Core/SSL;
|
||||
|
||||
file
|
||||
Socket.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "SSE2";
|
||||
|
||||
5
upptst/Socket/init
Normal file
5
upptst/Socket/init
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#ifndef _Socket_icpp_init_stub
|
||||
#define _Socket_icpp_init_stub
|
||||
#include "Core/init"
|
||||
#include "Core/SSL/init"
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue