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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FObjBase;
namespace OBJ_FileBus
{
public class Server_OBJProxy:FObj
{
Server mServer;
public Server_OBJProxy(int objsys_idx, Server server, UInt32 id)
: base(objsys_idx)
{
ID = id;
mServer = server;
mServer.SendMessageEvent += new Server.SendMessageEventHandler(mServer_SendMessageEvent);
}
public Server_OBJProxy(int objsys_idx, Server server)
:base(objsys_idx)
{
ID = FILEBUS_OBJ_INTERFACE.ID;
mServer = server;
mServer.SendMessageEvent += new Server.SendMessageEventHandler(mServer_SendMessageEvent);
}
void mServer_SendMessageEvent(Server.ClientInfo client, byte[] buf)
{
CurrObjSys.PushObjInfoEx(this, FILEBUS_OBJ_INTERFACE.PUSH_MSG, buf, client.conn, client.destid);
}
#region FLYOBJ 结构
public override void ConnectNotify(IFConn from)
{
if (from.IsConnected == false)
mServer.ClientRemove(new OBJ_FileBus.Server.ClientInfo() { conn = from });
}
public override void CallFunction(IFConn from, uint srcid, UInt32 magic, ushort funcid, byte[] infodata)
{
switch (funcid)
{
case FILEBUS_OBJ_INTERFACE.CALL_MSG:
{
byte[] retdata = null;
mServer.RequestService(
new Server.ClientInfo() { conn = from, destid = srcid },
infodata, out retdata);
if (retdata != null)
{
CurrObjSys.PushCallFunctionEx(from, srcid, ID, magic, funcid, retdata);
}
} break;
}
}
#endregion
}
}