Skip to content

Commit 9586400

Browse files
committed
update
1 parent 6744928 commit 9586400

File tree

13 files changed

+61
-19
lines changed

13 files changed

+61
-19
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,11 @@ dolphindb_csharpapi/bin/Release/dolphindb_csharpapi.pdb
3939
dolphindb_csharpapi/dolphindb_csharpapi.csproj.user
4040
dolphindb_csharpapi/dolphindb_csharpapi.csproj.user
4141
*.user
42+
.vs/dolphindb_csharpapi/v15/.suo
43+
dolphindb_csharpapi/nuget.exe
44+
dolphindb_csharpapi/dolphindb_csharpapi.nuspec
45+
dolphindb_csharpapi/dolphindb_csharpapi.1.0.0.nupkg
46+
dolphindb_csharpapi/release.bat
47+
dolphindb_csharpapi_test/obj/Release/CoreCompileInputs.cache
48+
dolphindb_csharpapi/obj/Release/CoreCompileInputs.cache
49+
.vs/dolphindb_csharpapi/v15/.suo

.vs/dolphindb_csharpapi/v15/.suo

20.5 KB
Binary file not shown.

bin/dolphindb_csharpapi.dll

116 KB
Binary file not shown.

dolphindb_csharpapi/DBConnection.cs

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,12 @@ public virtual IEntity tryRun(string script)
250250
}
251251
}
252252

253-
public virtual IEntity run(string script)
253+
public IEntity run(string script)
254254
{
255255
return run(script, (ProgressListener)null);
256256
}
257257

258-
public virtual bool tryReconnect()
258+
public bool tryReconnect()
259259
{
260260
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
261261
socket.Connect(hostName, port);
@@ -301,7 +301,7 @@ public virtual bool tryReconnect()
301301
return true;
302302
}
303303

304-
public virtual IEntity run(string script, ProgressListener listener)
304+
public IEntity run(string script, ProgressListener listener)
305305
{
306306
lock (threadLock)
307307
{
@@ -455,7 +455,7 @@ public virtual IEntity run(string script, ProgressListener listener)
455455
}
456456
}
457457

458-
public virtual IEntity tryRun(string function, IList<IEntity> arguments)
458+
public IEntity tryRun(string function, IList<IEntity> arguments)
459459
{
460460
if (isBusy())
461461
{
@@ -470,7 +470,7 @@ public virtual IEntity tryRun(string function, IList<IEntity> arguments)
470470
}
471471
}
472472

473-
public virtual IEntity run(string function, IList<IEntity> arguments)
473+
public IEntity run(string function, IList<IEntity> arguments)
474474
{
475475
lock (threadLock)
476476
{
@@ -615,7 +615,7 @@ public virtual IEntity run(string function, IList<IEntity> arguments)
615615

616616
}
617617

618-
public virtual void tryUpload(IDictionary<string, IEntity> variableObjectMap)
618+
public void tryUpload(IDictionary<string, IEntity> variableObjectMap)
619619
{
620620
if (isBusy())
621621
{
@@ -629,7 +629,7 @@ public virtual void tryUpload(IDictionary<string, IEntity> variableObjectMap)
629629
{
630630
}
631631
}
632-
public virtual void upload(IDictionary<string, IEntity> variableObjectMap)
632+
public void upload(IDictionary<string, IEntity> variableObjectMap)
633633
{
634634
if (variableObjectMap == null || variableObjectMap.Count == 0)
635635
{
@@ -745,11 +745,43 @@ public virtual void upload(IDictionary<string, IEntity> variableObjectMap)
745745
}
746746
if (this.startup != "") run(startup);
747747
}
748+
749+
int numObject = int.Parse(headers[1]);
750+
748751
string msg = @in.readLine();
749752
if (!msg.Equals("OK"))
750753
{
751754
throw new IOException(msg);
752755
}
756+
757+
if (numObject > 0)
758+
{
759+
try
760+
{
761+
short flag = @in.readShort();
762+
int form = flag >> 8;
763+
int type = flag & 0xff;
764+
765+
if (form < 0 || form > MAX_FORM_VALUE)
766+
{
767+
throw new IOException("Invalid form value: " + form);
768+
}
769+
if (type < 0 || type > MAX_TYPE_VALUE)
770+
{
771+
throw new IOException("Invalid type value: " + type);
772+
}
773+
774+
DATA_FORM df = (DATA_FORM)Enum.GetValues(typeof(DATA_FORM)).GetValue(form);
775+
DATA_TYPE dt = (DATA_TYPE)Enum.GetValues(typeof(DATA_TYPE)).GetValue(type);
776+
777+
IEntity re = factory.createEntity(df, dt, @in);
778+
}
779+
catch (IOException ex)
780+
{
781+
socket = null;
782+
throw ex;
783+
}
784+
}
753785
}
754786
finally
755787
{

dolphindb_csharpapi/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
3333
//通过使用 "*",如下所示:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.0")]
35+
[assembly: AssemblyVersion("1.0.0.10")]
3636
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b94b533843c0749de21218a97cc9b7645b7a9542
1+
5f31fec995e3516ee8132f57a767782ea8ecadbb

dolphindb_csharpapi/pack.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Nuget pack dolphindb_csharpapi.csproj

dolphindb_csharpapi/streaming/AbstractClient.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ protected void unsubscribeInternal(string host, int port, string tableName, stri
275275
dbConn.connect(host, port);
276276
try
277277
{
278-
string localIP = dbConn.LocalAddress;
278+
string localIP = listeningHost;
279+
if (localIP == null || localIP.Equals(String.Empty))
280+
localIP = dbConn.LocalAddress;
279281
List<IEntity> @params = new List<IEntity>
280282
{
281283
new BasicString(localIP),

dolphindb_csharpapi_test/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/*.user

0 commit comments

Comments
 (0)