forked from npgsql/npgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCancelRequestMessage.cs
More file actions
executable file
·44 lines (37 loc) · 1.16 KB
/
CancelRequestMessage.cs
File metadata and controls
executable file
·44 lines (37 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
using Common.Logging;
namespace Npgsql.FrontendMessages
{
class CancelRequestMessage : SimpleFrontendMessage
{
internal int BackendProcessId { get; set; }
internal int BackendSecretKey { get; set; }
const int CancelRequestCode = 1234 << 16 | 5678;
internal CancelRequestMessage(int backendProcessId, int backendSecretKey)
{
BackendProcessId = backendProcessId;
BackendSecretKey = backendSecretKey;
}
internal override int Length
{
get { return 16; }
}
internal override void Write(NpgsqlBuffer buf)
{
Contract.Requires(BackendProcessId != 0);
buf
.WriteInt32(Length)
.WriteInt32(CancelRequestCode)
.WriteInt32(BackendProcessId)
.WriteInt32(BackendSecretKey);
}
public override string ToString()
{
return String.Format("[CancelRequest(BackendProcessId={0})]", BackendProcessId);
}
}
}