Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
FMVip_Today
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhenfei.zhang
FMVip_Today
Commits
ce30629e
Commit
ce30629e
authored
Nov 10, 2016
by
Carwyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved: 1. 增加获取客户端Socket的入口;
parent
eee0b887
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
FMVipDC/fmapirelay.cpp
+12
-1
FMVipDC/fmapirelay.h
+3
-1
FMVipDC/fmsockserver.cpp
+1
-0
No files found.
FMVipDC/fmapirelay.cpp
View file @
ce30629e
...
...
@@ -11,7 +11,8 @@ using namespace rapidjson;
FMApiRelay
::
FMApiRelay
()
:
_response
(
0
),
_request
(
0
)
_request
(
0
),
_socket
(
-
1
)
{
}
...
...
@@ -36,6 +37,16 @@ BOOL FMApiRelay::Transfer( LPSTR data, LPSTR &rsp, UINT &rsp_len )
return
TRUE
;
}
void
FMApiRelay
::
SetSocketDescriptor
(
const
SOCKET
s
)
{
_socket
=
s
;
}
SOCKET
FMApiRelay
::
GetSocketDescriptor
()
const
{
return
_socket
;
}
INT
FMApiRelay
::
_ParseRequest
(
LPSTR
data
)
{
...
...
FMVipDC/fmapirelay.h
View file @
ce30629e
...
...
@@ -25,7 +25,8 @@ public:
const
char
*
Request
()
{
return
_request
;
}
const
char
*
Response
()
{
return
_response
;
}
virtual
BOOL
Transfer
(
LPSTR
data
,
LPSTR
&
rsp
,
UINT
&
rsp_len
);
void
SetSocketDescriptor
(
const
SOCKET
s
);
SOCKET
GetSocketDescriptor
()
const
;
protected
:
virtual
INT
_ParseRequest
(
LPSTR
data
);
virtual
BOOL
_GetResponse
(
LPSTR
&
rsp
,
UINT
&
len
);
...
...
@@ -35,6 +36,7 @@ protected:
char
*
_response
;
char
*
_request
;
FMApiCfg
_cfg
;
SOCKET
_socket
;
};
#ifdef __cplusplus
...
...
FMVipDC/fmsockserver.cpp
View file @
ce30629e
...
...
@@ -109,6 +109,7 @@ BOOL FMSockServer::_Listen()
//! Receive length first
io_data
->
buffer
.
len
=
sizeof
(
io_data
->
header
);
io_data
->
buffer
.
buf
=
(
char
*
)
&
io_data
->
header
;
_relay
->
SetSocketDescriptor
(
sclient
);
io_data
->
relay
=
_relay
;
io_data
->
socket
=
sclient
;
io_data
->
offset
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment