Skip to content

Commit be8b21d

Browse files
committed
Code fixes related to running replicator in .NET6
1 parent 366f556 commit be8b21d

11 files changed

Lines changed: 380 additions & 200 deletions

File tree

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
namespace FileService.Properties
2-
3-
{System.Runtime.CompilerServices.CompilerGeneratedAttribute()}
4-
{System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.5.0.0")}
5-
internal sealed partial class Settings inherits System.Configuration.ApplicationSettingsBase
6-
7-
private static defaultInstance, @Settings, (@Settings)System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())
8-
9-
public static property Default, @Settings
10-
method get
11-
proc
12-
mreturn defaultInstance
13-
endmethod
14-
endproperty
15-
16-
{System.Configuration.ApplicationScopedSettingAttribute()}
17-
{System.Diagnostics.DebuggerNonUserCodeAttribute()}
18-
{System.Configuration.DefaultSettingValueAttribute("")}
19-
public property StorageFolder, string
20-
method get
21-
proc
22-
mreturn (string)this["StorageFolder"]
23-
endmethod
24-
endproperty
25-
26-
{System.Configuration.ApplicationScopedSettingAttribute()}
27-
{System.Diagnostics.DebuggerNonUserCodeAttribute()}
28-
{System.Configuration.DefaultSettingValueAttribute("8080")}
29-
public property HttpListenerPort, int
30-
method get
31-
proc
32-
mreturn (int)this["HttpListenerPort"]
33-
endmethod
34-
endproperty
35-
endclass
2+
3+
{System.Runtime.CompilerServices.CompilerGeneratedAttribute()}
4+
{System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.6.0.0")}
5+
internal sealed partial class Settings inherits System.Configuration.ApplicationSettingsBase
6+
7+
private static defaultInstance, @Settings, (@Settings)System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())
8+
9+
public static property Default, @Settings
10+
method get
11+
proc
12+
mreturn defaultInstance
13+
endmethod
14+
endproperty
15+
16+
{System.Configuration.ApplicationScopedSettingAttribute()}
17+
{System.Diagnostics.DebuggerNonUserCodeAttribute()}
18+
{System.Configuration.DefaultSettingValueAttribute("")}
19+
public property StorageFolder, string
20+
method get
21+
proc
22+
mreturn (string)this["StorageFolder"]
23+
endmethod
24+
endproperty
25+
26+
{System.Configuration.ApplicationScopedSettingAttribute()}
27+
{System.Diagnostics.DebuggerNonUserCodeAttribute()}
28+
{System.Configuration.DefaultSettingValueAttribute("8080")}
29+
public property HttpListenerPort, int
30+
method get
31+
proc
32+
mreturn (int)this["HttpListenerPort"]
33+
endmethod
34+
endproperty
35+
endclass
3636
endnamespace
3737

PRJVS/tools/tools.synproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<Platform Condition=" '$(Configuration)' == '' ">x86</Platform>
66
<Name>tools</Name>
7-
<StartupObject>Program1.dbl</StartupObject>
7+
<StartupObject>ReplicatorMenu.dbl</StartupObject>
88
<OutputName>$(StartupObject)</OutputName>
99
<ProjectGuid>{123f18a8-db24-4ed3-91bf-ed7917bef4c1}</ProjectGuid>
1010
<ProjectTypeGuids>{7B8CF543-378A-4EC1-BB1B-98E4DC6E6820};{BBD0F5D1-1CC4-42fd-BA4C-A96779C64378}</ProjectTypeGuids>

SRC/LIBRARY/DepartmentSqlIO.dbl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,10 +1931,10 @@ endfunction
19311931
function DepartmentBulkLoad, ^val
19321932

19331933
required in a_dbchn, i
1934-
required in a_commit_mode, i
1935-
required in a_localpath, string
1936-
required in a_server, string
1937-
required in a_port, string
1934+
required in a_commit_mode,i
1935+
required in a_localpath, a
1936+
required in a_server, a
1937+
required in a_port, i
19381938
required in a_db_timeout, n
19391939
required in a_bl_timeout, n
19401940
optional in a_logchannel, n
@@ -1978,7 +1978,7 @@ proc
19781978

19791979
;;If we're doing a remote bulk load, create an instance of the FileService client and verify that we can access the FileService server
19801980

1981-
if (remoteBulkLoad = ((a_server!=^null) && (a_server.nes." ")))
1981+
if (remoteBulkLoad = (a_server.nes." "))
19821982
begin
19831983
fsc = new FileServiceClient(a_server,a_port)
19841984

SRC/LIBRARY/EmployeeSqlIO.dbl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,10 +2201,10 @@ endfunction
22012201
function EmployeeBulkLoad, ^val
22022202

22032203
required in a_dbchn, i
2204-
required in a_commit_mode, i
2205-
required in a_localpath, string
2206-
required in a_server, string
2207-
required in a_port, string
2204+
required in a_commit_mode,i
2205+
required in a_localpath, a
2206+
required in a_server, a
2207+
required in a_port, i
22082208
required in a_db_timeout, n
22092209
required in a_bl_timeout, n
22102210
optional in a_logchannel, n
@@ -2248,7 +2248,7 @@ proc
22482248

22492249
;;If we're doing a remote bulk load, create an instance of the FileService client and verify that we can access the FileService server
22502250

2251-
if (remoteBulkLoad = ((a_server!=^null) && (a_server.nes." ")))
2251+
if (remoteBulkLoad = (a_server.nes." "))
22522252
begin
22532253
fsc = new FileServiceClient(a_server,a_port)
22542254

SRC/LIBRARY/FileChunkReader.dbl

Lines changed: 82 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -37,93 +37,98 @@
3737

3838
namespace ReplicationLibrary
3939

40-
public class FileChunkReader
40+
;;; <summary>
41+
;;; Read a file in large chunks.
42+
;;; </summary>
43+
public class FileChunkReader
4144

42-
structure block
43-
, a32768
44-
endstructure
45+
structure strBlock
46+
, a32768
47+
endstructure
4548

46-
private channel, int
49+
private mChannel, int
4750

48-
private blockSize, int, ^size(block)
49-
private blockCount, int
50-
private chunkSize, int
51-
private chunkData, D_HANDLE
51+
private blockSize, int, ^size(strBlock)
52+
private blockCount, int
53+
private chunkSize, int
54+
private chunkData, D_HANDLE
5255

53-
;;; <summary>
54-
;;;
55-
;;; </summary>
56-
;;; <param name="aFileSpec"></param>
57-
;;; <param name="aChunkSize">Chunk size in number of 32K blocks (32=1MB)</param>
58-
public method FileChunkReader
59-
required in aFileSpec, string
60-
required in aBlockCount, int
61-
proc
62-
.ifdef OS_VMS
63-
open(channel=0,i,aFileSpec,OPTIONS:"/stream")
64-
.else
65-
open(channel=0,i,aFileSpec)
66-
.endc
67-
blockCount = aBlockCount
68-
chunkSize = ^size(block) * blockCount
69-
chunkData = %mem_proc(DM_ALLOC|DM_STATIC|DM_BLANK,chunkSize)
70-
endmethod
56+
;;; <summary>
57+
;;;
58+
;;; </summary>
59+
;;; <param name="aFileSpec"></param>
60+
;;; <param name="aChunkSize">Chunk size in number of 32K blocks (32=1MB)</param>
61+
public method FileChunkReader
62+
required in aFileSpec, string
63+
required in aBlockCount, int
64+
proc
65+
.ifdef OS_VMS
66+
open(mChannel=0,i,aFileSpec,OPTIONS:"/stream")
67+
.else
68+
open(mChannel=0,i,aFileSpec)
69+
.endc
70+
blockCount = aBlockCount
71+
chunkSize = ^size(strBlock) * blockCount
72+
chunkData = %mem_proc(DM_ALLOC|DM_STATIC|DM_BLANK,chunkSize)
73+
endmethod
7174

72-
public method Cleanup, void
73-
proc
74-
if (channel && %chopen(channel))
75-
begin
76-
close channel
77-
clear channel
78-
end
79-
try
80-
begin
81-
chunkData = %mem_proc(DM_FREE,chunkData)
82-
end
83-
catch (e, @Exception)
84-
begin
85-
nop
86-
end
87-
endtry
88-
endmethod
75+
;;; <summary>
76+
;;; Close channels and free dynamic memory
77+
;;; </summary>
78+
public method Cleanup, void
79+
proc
80+
if (mChannel && %chopen(mChannel))
81+
begin
82+
close mChannel
83+
clear mChannel
84+
end
85+
try
86+
begin
87+
chunkData = %mem_proc(DM_FREE,chunkData)
88+
end
89+
catch (e, @Exception)
90+
begin
91+
nop
92+
end
93+
endtry
94+
endmethod
8995

90-
public method ReadChunk, boolean
91-
required out aChunkData, D_HANDLE
92-
stack record
93-
more, boolean
94-
blockNumber, int
95-
lastChunkSize, int
96-
endrecord
97-
proc
98-
more = true
96+
public method ReadChunk, boolean
97+
required out aChunkData, D_HANDLE
98+
stack record
99+
more, boolean
100+
blockNumber, int
101+
lastChunkSize, int
102+
endrecord
103+
proc
104+
more = true
99105

100-
;;Read the next chunk of data from the file
101-
try
102-
begin
103-
for blockNumber from 1 thru blockCount
104-
begin
105-
gets(channel,^m(block[blockNumber],chunkData))
106-
end
107-
end
108-
catch (ex, @EndOfFileException)
109-
begin
110-
;;We hit EOF. Resize handle to exact size of the last chunk of data
111-
if (lastChunkSize = (blockSize*(blockNumber-1))+%rsize) then
112-
chunkData = %mem_proc(DM_RESIZ,lastChunkSize,chunkData)
113-
else
114-
chunkData = %mem_proc(DM_FREE,chunkData)
115-
more = false
116-
end
117-
endtry
106+
;;Read the next chunk of data from the file
107+
try
108+
begin
109+
for blockNumber from 1 thru blockCount
110+
begin
111+
gets(mChannel,^m(strBlock[blockNumber],chunkData))
112+
end
113+
end
114+
catch (ex, @EndOfFileException)
115+
begin
116+
;;We hit EOF. Resize handle to exact size of the last chunk of data
117+
if (lastChunkSize = (blockSize*(blockNumber-1))+%rsize) then
118+
chunkData = %mem_proc(DM_RESIZ,lastChunkSize,chunkData)
119+
else
120+
chunkData = %mem_proc(DM_FREE,chunkData)
121+
more = false
122+
end
123+
endtry
118124

119-
;;Return the handle to the client
120-
aChunkData = chunkData
125+
;;Return the handle to the client
126+
aChunkData = chunkData
121127

122-
mreturn more
128+
mreturn more
123129

124-
endmethod
130+
endmethod
125131

126-
127-
endclass
132+
endclass
128133

129134
endnamespace

0 commit comments

Comments
 (0)