forked from sijms/go-ora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
session_ctx.go
58 lines (54 loc) · 1.47 KB
/
session_ctx.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package network
//internal static readonly int NSVSNDHS = 311;
//internal static readonly int NSVSNRDS = 312;
//internal static readonly int NSVSNRDR = 312;
//internal static readonly int NSVSNDHO = 312;
//internal static readonly int NSVSNDHE = 314;
//internal static readonly int NSVSNIP6 = 314;
//internal static readonly int NSVSNSRN = 313;
//internal static readonly int NSVSNPPP = 313;
type SessionContext struct {
//conn net.Conn
connOption ConnectionOption
//PortNo int
//InstanceName string
//HostName string
//IPAddress string
//Protocol string
//ServiceName string
SID []byte
//internal Stream m_socketStream;
//internal Socket m_socket;
//internal ReaderStream m_readerStream;
//internal WriterStream m_writerStream;
//internal ITransportAdapter m_transportAdapter;
//ConnectData string
Version uint16
LoVersion uint16
Options uint16
NegotiatedOptions uint16
OurOne uint16
Histone uint16
ReconAddr string
//internal Ano m_ano;
//internal bool m_bAnoEnabled;
ACFL0 uint8
ACFL1 uint8
SessionDataUnit uint16
TransportDataUnit uint16
UsingAsyncReceivers bool
IsNTConnected bool
OnBreakReset bool
GotReset bool
}
func NewSessionContext(connOption ConnectionOption) *SessionContext {
return &SessionContext{
SessionDataUnit: connOption.SessionDataUnitSize,
TransportDataUnit: connOption.TransportDataUnitSize,
Version: 312,
LoVersion: 300,
Options: 1 | 1024 | 2048,
OurOne: 1,
connOption: connOption,
}
}