Skip to content

Commit

Permalink
fix(cs): 修复发送文件时文件头部多出4字节的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pdt012 committed Mar 11, 2023
1 parent c56afb3 commit a7c0565
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cs/hsocket/hsocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public Message RecvMsg()
public void SendFile(FileStream file, string filename)
{
// get file size
long filesize = file.Length;
int filesize = (int)file.Length;
// file header
Send(Encoding.UTF8.GetBytes(filename)); // filename
Send(new byte[1] { 0 }); // name end
Expand Down

0 comments on commit a7c0565

Please sign in to comment.