public virtual void ProcessAtServer() { try { BlobImpl blobImpl = this.ServerGetBlobImpl(); if (blobImpl != null) { blobImpl.SetTrans(Transaction()); Sharpen.IO.File file = blobImpl.ServerFile(null, false); int length = (int)file.Length(); Socket4Adapter sock = ServerMessageDispatcher().Socket(); Msg.Length.GetWriterForInt(Transaction(), length).Write(sock); FileInputStream fin = new FileInputStream(file); Copy(fin, sock, false); sock.Flush(); Msg.Ok.Write(sock); } } catch (Exception) { Write(Msg.Error); } }
public virtual void ProcessAtServer() { try { var blobImpl = ServerGetBlobImpl(); if (blobImpl != null) { blobImpl.SetTrans(Transaction()); var file = blobImpl.ServerFile(null, false); var length = (int) file.Length(); var sock = ServerMessageDispatcher().Socket(); Length.GetWriterForInt(Transaction(), length).Write(sock); var fin = new FileInputStream(file); Copy(fin, sock, false); sock.Flush(); Ok.Write(sock); } } catch (Exception) { Write(Error); } }