Browse CVS Repository
Annotation of /xoonips/AL/session.cc
Parent Directory
| Revision Log
| Revision Graph
Revision 1.1 -
( hide annotations)
( download)
( as text)
Wed Nov 24 06:54:04 2004 UTC
(19 years, 4 months ago)
by youi
Branch: MAIN
File MIME type: text/x-c++src
initial version
| 1 |
youi |
1.1 |
/* |
| 2 |
|
|
* |
| 3 |
|
|
* セッション管理用クラスの定義 |
| 4 |
|
|
* |
| 5 |
|
|
* $Revision$ |
| 6 |
|
|
* $Log$ |
| 7 |
|
|
* |
| 8 |
|
|
*/ |
| 9 |
|
|
|
| 10 |
|
|
#include <stdlib.h> |
| 11 |
|
|
|
| 12 |
|
|
#include "session.h" |
| 13 |
|
|
|
| 14 |
|
|
session::session() |
| 15 |
|
|
{ |
| 16 |
|
|
sessionID = 0; |
| 17 |
|
|
remoteHost = 0; |
| 18 |
|
|
date = 0; |
| 19 |
|
|
} |
| 20 |
|
|
|
| 21 |
|
|
session::session( unsigned long remoteHost, time_t date ) |
| 22 |
|
|
{ |
| 23 |
|
|
this -> remoteHost = remoteHost; |
| 24 |
|
|
this -> date = date; |
| 25 |
|
|
|
| 26 |
|
|
sessionid( remoteHost, date ); |
| 27 |
|
|
} |
| 28 |
|
|
|
| 29 |
|
|
session::~session(){} |
| 30 |
|
|
|
| 31 |
|
|
unsigned long session::getSessionID(){ return sessionID; } |
| 32 |
|
|
unsigned long session::getRemoteHost(){ return remoteHost; } |
| 33 |
|
|
time_t session::getDate(){ return date; } |
| 34 |
|
|
|
| 35 |
|
|
void session::setRemoteHost( unsigned long remoteHost ) |
| 36 |
|
|
{ |
| 37 |
|
|
this -> remoteHost = remoteHost; |
| 38 |
|
|
sessionid( remoteHost, date ); |
| 39 |
|
|
} |
| 40 |
|
|
void session::setDate( time_t date ) |
| 41 |
|
|
{ |
| 42 |
|
|
this -> date = date; |
| 43 |
|
|
sessionid( remoteHost, date ); |
| 44 |
|
|
} |
| 45 |
|
|
|
| 46 |
|
|
void session::sessionid( unsigned long remoteHost, time_t date ) |
| 47 |
|
|
{ |
| 48 |
|
|
srand( time( NULL ) ); |
| 49 |
|
|
sessionID = remoteHost ^ date ^ rand( ); |
| 50 |
|
|
} |
|