Skip to content

Commit fbdafa2

Browse files
committed
fixed some bugs in the serializing of NodeStatus
1 parent 5204c0e commit fbdafa2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

SocketBase/NodeStatus.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public void Save(string filePath)
4141
using (var stream = File.Create(filePath))
4242
{
4343
serializer.Serialize(stream, this);
44+
stream.Flush();
4445
stream.Close();
4546
}
4647
}
@@ -54,7 +55,7 @@ public static NodeStatus LoadFrom(string filePath)
5455
{
5556
var serializer = new BinaryFormatter();
5657

57-
using (var stream = File.Create(filePath))
58+
using (var stream = File.Open(filePath, FileMode.Open, FileAccess.Read))
5859
{
5960
var status = serializer.Deserialize(stream) as NodeStatus;
6061
stream.Close();

0 commit comments

Comments
 (0)