CN109981640A - Connect method for building up and device - Google Patents
Connect method for building up and device Download PDFInfo
- Publication number
- CN109981640A CN109981640A CN201910226248.2A CN201910226248A CN109981640A CN 109981640 A CN109981640 A CN 109981640A CN 201910226248 A CN201910226248 A CN 201910226248A CN 109981640 A CN109981640 A CN 109981640A
- Authority
- CN
- China
- Prior art keywords
- vpn
- specified
- redis
- interface
- mark
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Small-Scale Networks (AREA)
Abstract
This application provides connection method for building up and devices.In this application, VPN mark is bound by the specified interface to connect specified Redis server-side in Redis client, to distinguish Redis server-side based on VPN mark, it realizes under the premise of same Redis client while at least two difference Redis server-side (IP address is identical) of connection, as long as the VPN mark for connecting the port binding of these difference Redis server-sides in Redis client is different, Redis client just can be identified by VPN and distinguish variant Redis server-side, and success variant Redis server-side identical with IP address establishes TCP connection.
Description
Technical field
This application involves network communication technologies, in particular to connection method for building up and device.
Background technique
Long-range Dictionary server (Redis:Remote dictionary server) is a kind of the memory-based of open source
Data structure memory, is usually implemented as database.In the application, Redis client is responsible for Redis server-side backup number
According to.
In network application environment, it can be established between Redis client and Redis server-side and belong to publicly-owned Virtual Private Network
The TCP connection of network (VPN:Virtual Private Network).But because there is IP address resource in network application environment
Limit, often occur the problem that identical IP address is assigned at least two network equipments such as Redis server-side.Such as Fig. 1
Shown, identical IP address 192.168.5.10 is assigned in Redis server-side 1020 and Redis server-side 1021.Such situation
Under because Redis server-side 1020 with Redis server-side 1021 there are IP address conflict (IP address is identical), then will lead to
Redis client 1011 can not be successfully established the TCP for belonging to public network VPN with Redis server-side 1020, Redis server-side 1021
Connection.
Summary of the invention
In view of this, this application provides a kind of connection method for building up and device, to connect simultaneously in same Redis client
Under the scene for connecing the different Redis server-sides with identical IP address, realize that Redis client succeeds and has identical IP address
Variant Redis server-side establish TCP connection.
In a first aspect, this method is applied to Redis client this application provides a kind of connection method for building up, comprising:
Creation includes at least the socket address structure of VPN index, socket address structure and the socket pair created
It answers, TCP connection to be established is associated between socket and Redis client and specified Redis server-side, and VPN index is Redis
The index for the VPN mark that specified interface is bound in client, specified interface are that specified Redis service is connected in Redis client
The interface at end;
It establishes and returns between Redis client and specified Redis server-side according to the VPN index in socket address structure
Belong to the TCP connection that above-mentioned VPN identifies corresponding VPN.
With reference to first aspect, in the first possible implementation, before creating socket address structure, above-mentioned side
Method further include:
Receive configuration-direct, configuration-direct be used to indicate for specified interface bind VPN mark, configuration-direct carry to finger
The VPN mark of stationary interface binding;
The VPN for checking that configuration-direct carries is identified whether and other interfaces in Redis client in addition to specified interface
The VPN mark of binding is identical;
If not, the VPN mark that configuration-direct is carried is bound with specified interface;
If so, the IP address of the opposite equip. according to the connection of other interfaces and the specified Redis of specified interface connection
The IP address of server-side judges whether that the VPN for carrying configuration-direct mark is bound with specified interface.
The possible implementation of with reference to first aspect the first, in the second possible implementation, according to other
The IP address of the specified Redis server-side of the IP address and specified interface connection of the opposite equip. of interface connection, judges whether
VPN mark and the specified interface that configuration-direct is carried are bound, comprising:
The specified Redis service that the IP address of the opposite equip. of more above-mentioned other interfaces connection is connected with specified interface
The IP address at end;
If identical, forbid binding and returning to Bind Failed the VPN mark that configuration-direct carries with specified interface disappearing
Breath;
If it is different, then the VPN mark that configuration-direct is carried is bound with specified interface.
With reference to first aspect, in the third possible implementation, creation includes at least the socket address of VPN index
Structure, comprising:
Obtain the VPN index for being reported in Redis client;
Socket address structure is created, and the VPN index obtained is added to the designated position of socket address structure.
With reference to first aspect, in the fourth possible implementation, exist according to the VPN index in socket address structure
The TCP connection for belonging to VPN is established between Redis client and specified Redis server-side, comprising:
By having bound the specified interface of the VPN mark, carry out with the specified Redis server-side for TCP
The interaction of connection, to establish TCP between the specified interface of the Redis client and the specified Redis server-side
Connection, the TCP connection belong to the VPN and identify corresponding VPN.
Second aspect, this application provides a kind of connections to establish device, which is applied to Redis client, comprising:
Word modules are socketed, for create the socket address structure for including at least VPN index, socket address structure and
The socket of creation is corresponding, and TCP connection to be established is associated between socket and Redis client and specified Redis server-side,
VPN index is the index of the VPN mark of specified interface binding in Redis client, and specified interface is to connect in Redis client
The interface of specified Redis server-side;
TCP connection module, for the VPN index in foundation socket address structure in Redis client and specified Redis
It is established between server-side and belongs to the TCP connection that VPN identifies corresponding VPN.
With reference to first aspect, in the first possible implementation, which further comprises:
VPN module, for receiving configuration-direct, configuration-direct before socket module creation socket address structure
It is used to indicate and binds VPN mark for specified interface, configuration-direct carries the VPN mark to bind with specified interface;
The VPN for checking that configuration-direct carries is identified whether and other interfaces in Redis client in addition to specified interface
The VPN mark of binding is identical;
If not, the VPN mark that configuration-direct is carried is bound with specified interface;
If so, the IP address of the opposite equip. according to the connection of other interfaces and the specified Redis of specified interface connection
The IP address of server-side judges whether that the VPN for carrying configuration-direct mark is bound with specified interface.
In conjunction with the first possible implementation of second aspect, in the second possible implementation, VPN module according to
According to the IP address of the specified Redis server-side of the IP address and specified interface connection of the opposite equip. of other interfaces connection, sentence
The disconnected VPN mark whether carried configuration-direct is bound with specified interface, comprising:
The IP for the specified Redis server-side that the IP address of the opposite equip. of more other interface connections is connected with specified interface
Address;
If identical, forbid binding and returning to Bind Failed the VPN mark that configuration-direct carries with specified interface disappearing
Breath;
If it is different, then the VPN mark that configuration-direct is carried is bound with specified interface.
In conjunction with second aspect, in the third possible implementation, socket module creation includes at least VPN index
Socket address structure, comprising:
Obtain the VPN index for being reported in Redis client;
Socket address structure is created, and the VPN index obtained is added to the designated position of socket address structure.
In conjunction with second aspect, in the fourth possible implementation, TCP connection module is according in socket address structure
VPN index the TCP connection for belonging to VPN is established between Redis client and specified Redis server-side, comprising:
By having bound the specified interface of the VPN mark, carry out with the specified Redis server-side for TCP
The interaction of connection, to establish TCP between the specified interface of the Redis client and the specified Redis server-side
Connection, the TCP connection belong to the VPN and identify corresponding VPN.
The third aspect, this application provides a kind of electronic equipment, comprising: machine readable storage medium and processor, machine
Readable storage medium storing program for executing: store instruction code, processor: communicating with machine readable storage medium, reads and executees machine readable deposit
Instruction code in storage media realizes above-mentioned connection method for building up.
Fourth aspect, this application provides a kind of machine readable storage mediums, if being stored on machine readable storage medium
Dry computer instruction, computer instruction, which is performed, executes above-mentioned connection method for building up.
As can be seen from the above technical solutions, in the application, by the way that specified Redis service will be connected in Redis client
The specified interface binding VPN mark at end, establishes TCP using the specified interface and specified Redis server-side of binding VPN mark and connects
It connects, and then distinguishes the different Redis server-sides of specific identical IP address using VPN.It is thereby achieved that in same Redis client
Under the scene of end while at least two difference Redis server-sides (IP address is identical) of connection, as long as connecting this in Redis client
The VPN of the port binding of a little difference Redis server-sides identifies difference, and it is variant that Redis client just can identify differentiation by VPN
Redis server-side, success variant Redis server-side identical with IP address establish TCP connection.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows the implementation for meeting the disclosure
Example, and together with specification for explaining the principles of this disclosure.
Fig. 1 is Redis client and Redis server-side networking application figure;
Fig. 2 is method flow diagram provided by the embodiments of the present application;
Fig. 3 is that VPN index provided by the embodiments of the present application and specified interface bind flow chart;
Fig. 4 is application schematic diagram provided by the embodiments of the present application;
Fig. 5 is apparatus structure schematic diagram provided by the embodiments of the present application;
Fig. 6 is the hardware structural diagram of Fig. 5 shown device provided by the embodiments of the present application.
Specific embodiment
Currently, establishing TCP connection between Redis client and Redis server-side by publicly-owned VPN.This TCP connection
Mode is established, limits Redis server-side 1020 shown in FIG. 1, under the premise of Redis server-side 1021 has identical IP address,
Redis client 1011 because cannot be distinguished Redis server-side 1020, Redis server-side 1021 and cannot succeed and Redis take
Business end 1020, Redis server-side 1021 establish TCP connection.
To solve the above-mentioned problems, realize that at least two IP address of connection are identical not simultaneously in same Redis client
Under the premise of Redis server-side, the Redis client variant Redis server-side identical with IP address that can also succeed is built
Vertical TCP connection, the embodiment of the present application provide process shown in Fig. 2:
Referring to fig. 2, Fig. 2 is method flow diagram provided by the embodiments of the present application.The process is applied to Redis client.
As shown in Fig. 2, the process the following steps are included:
Step 201, creation includes at least the socket address structure of VPN index.
As one embodiment, Redis client and (any Redis service of specified Redis server-side are being established
End) between TCP connection when, Redis client can first call Socket function creation socket.Socket be based on interface and
IP address, interface here refers to that the interface for establishing TCP connection with specified Redis server-side in Redis client (is denoted as finger
Stationary interface), IP address is the IP address of specified Redis server-side.
After creation socket success, Socket function can return to a socket descriptor.Here socket word description
Symbol is for uniquely describing the socket of above-mentioned creation.
Meanwhile Redis client will also create a socket address structure.Here socket address structure with it is above-mentioned
The socket of creation is relevant (referred to as corresponding).In the embodiment of the present application, Redis client creates socket address structure
Creation mode of the mode similar to existing socket address structure, but the content that the socket address structure being finally created that includes
Changed compared to existing socket address structure.
In one example, above-mentioned change refers to: adding additional VPN rope in the socket address structure being created that
Draw.At this point, the socket address structure that Redis client is created that still inherits existing socket address in the embodiment of the present application
The requirement (parameter that specifically should include) of structure.
In another example, above-mentioned change refers to: VPN rope is included at least in the socket address structure being created that
Draw.At this point, the socket address structure being created that in the embodiment of the present application is with can not inheriting or herid partially existing socket
The requirement (parameter that should include) of location structure, the embodiment of the present application does not limit specifically.
As one embodiment, above-mentioned VPN index is the index of the VPN mark of above-mentioned specified interface binding.In an example
In son, above-mentioned VPN index is to be recorded in Redis client before creating socket address structure with code form.Based on this,
In step 201 creation include at least VPN index socket address structure include:
Obtain the VPN index for being reported in Redis client;
Socket address structure is created, and the VPN index obtained is added to the designated position of socket address structure.
Here, designated position can be last clear position in socket address structure.It finally realizes and how to create including at least VPN rope
The socket address structure drawn.
Step 202, according to the VPN index in socket address structure Redis client and specified Redis server-side it
Between establish belong to the TCP connection that above-mentioned VPN identifies corresponding VPN.
In one example, VPN mark is corresponding with above-mentioned VPN index.
In one example, step 202 can be realized by following steps a:
Step a is used for by having bound the specified interface of above-mentioned VPN mark with specified Redis server-side
The interaction of TCP connection, to establish TCP connection between the specified interface of Redis client and specified Redis server-side, TCP connects
It connects and belongs to the corresponding VPN of VPN mark.
It is above-mentioned to carry out for the interaction of TCP connection being such as TCP's with specified Redis server-side as one embodiment
Three-way handshake etc..
So far, process shown in Fig. 2 is completed.
It can be seen that in the embodiment of the present application by process shown in Fig. 2, it is specified by will be connected in Redis client
The specified interface binding VPN mark of Redis server-side, is built using the specified interface of binding VPN mark with specified Redis server-side
Vertical TCP connection, and then utilize the different Redis server-sides of the specific identical IP address of VPN differentiation.It is thereby achieved that same
Redis client is connected simultaneously under the scene of at least two difference Redis server-sides (IP address is identical), as long as Redis client
The VPN mark that the port binding of these difference Redis server-sides is connected on end is different, and Redis client just can be identified by VPN
Variant Redis server-side is distinguished, success variant Redis server-side identical with IP address establishes TCP connection.
Optionally, in one embodiment, before process shown in Fig. 2, Redis client can create VPN mark, and will
VPN mark is bound with specified interface.
As one embodiment, VPN mark and specified interface binding can be passed through the reality of process shown in Fig. 3 by Redis client
It is existing.As shown in figure 3, the process can include:
Step 301, Redis client receives configuration-direct, and configuration-direct, which is used to indicate, binds VPN mark for specified interface
Know, configuration-direct carries the VPN mark to bind with specified interface.
When binding VPN mark for specified interface, it can first determine which VPN mark need to connect with specified according to actual needs
Mouth binding.Once it is determined that VPN is identified, then the VPN determined can be identified carrying and be sent to Redis client in configuration-direct.
Step 302, Redis client check VPN that configuration-direct carries identify whether in Redis client except specified
The VPN mark of other interfaces binding except interface is identical, if not, VPN is identified corresponding VPN and specified interface binding;
If so, the specified Redis server-side of the IP address and specified interface connection of the opposite equip. according to the connection of other interfaces
IP address judges whether that the VPN for carrying configuration-direct mark is bound with specified interface.
As one embodiment, according to the IP address of the opposite equip. of other interfaces connection and specified in this step 302
The IP address of the specified Redis server-side of interface connection judges whether to identify the VPN that configuration-direct carries ties up with specified interface
It is fixed can include:
The IP for the specified Redis server-side that the IP address of the opposite equip. of more other interface connections is connected with specified interface
Address;
If identical, forbid binding and returning to Bind Failed the VPN mark that configuration-direct carries with specified interface disappearing
Breath;Here, as one embodiment, Bind Failed message, which may be used to indicate, re-issues configuration-direct again for specified interface
Bind VPN mark.
If it is different, then the VPN mark that configuration-direct is carried is bound with specified interface.
It is finally realized through the above steps in same Redis client while connecting at least two difference Redis service
Under the premise of holding (IP address is identical), by the port binding for connecting these difference Redis server-sides in Redis client
VPN identifies each difference Redis server-side of different instructions, to guarantee that the success of Redis client is identical with IP address variant
Redis server-side establishes TCP connection.
It should be noted that in the embodiment of the present application, when binding VPN mark for specified interface, Redis client can
Further generate to deserved VPN index.Here the VPN index generated can be dependent on the order of the configuration order received to set
It sets, for example, the order of currently received configuration order is 10, then VPN index is 10.
So far, process shown in Fig. 3 is completed.
By process shown in Fig. 3, finally realizes and how to be identified for specified interface binding VPN.
Based on process shown in Fig. 2, Fig. 3, it is described below by a specific embodiment:
Referring to fig. 4, Fig. 4 is application schematic diagram provided in this embodiment.As shown in figure 4, Redis client 401 is by connecing
Mouth eth12 and Redis server-side 402, and connect by interface eth13 with Redis server-side 403.In Fig. 4, Redis clothes
Business end 402 is identical as the IP address of Redis server-side 403, is 192.168.5.12.The IP address of Redis client 401 is
192.168.5.11。
In Fig. 4, based on process shown in Fig. 3, then finally, the interface eth12 and VPN41 of Redis client 401 are bound,
The interface eth13 and VPN42 of Redis client 401 are bound.
In Fig. 4, because the interface eth12 and VPN41 of Redis client 401 are bound, it means that Redis client
The Redis server-side 402 of 401 interface eth12 connection is based on VPN41, therefore, in Redis client 401 and Redis
Server-side 402 can be established when establishing TCP connection based on VPN41.Based on process shown in Fig. 2, then Redis client 401 is eventually
The TCP connection for being in VPN41 is established between Redis server-side 402.
Equally, because the interface eth13 and VPN42 of Redis client 401 are bound, it means that Redis client 401
The Redis server-side 403 of interface eth13 connection be therefore, to be serviced in Redis client 401 and Redis based on VPN42
End 403 can be established when establishing TCP connection based on VPN42.Based on process shown in Fig. 2, then Redis client 401 eventually with
The TCP connection for being in VPN42 is established between Redis server-side 403.
It finally realizes even if Redis server-side 402, the IP address having the same of Redis server-side 403, but Redis visitor
Family end 401 by VPN41, VPN42 distinguish Redis server-side 402, Redis server-side 403, can with Redis server-side 402,
Redis server-side 403 establishes the TCP connection for belonging to different VPN respectively.
So far, the description of embodiment illustrated in fig. 4 is completed.
Method provided by the present application is described above.Device provided by the present application is described below:
Referring to Fig. 5, Fig. 5 is structure drawing of device provided in this embodiment.As shown in figure 5, the device can include:
Word modules are socketed, for create the socket address structure for including at least VPN index, socket address structure and
The socket of creation is corresponding, and TCP connection to be established is associated between socket and Redis client and specified Redis server-side,
VPN index is the index of the VPN mark of specified interface binding in Redis client, and specified interface is to connect in Redis client
The interface of specified Redis server-side;
TCP connection module, for the VPN index in foundation socket address structure in Redis client and specified Redis
It is established between server-side and belongs to the TCP connection that VPN identifies corresponding VPN.
In one example, as shown in figure 5, the device further comprises:
VPN module, for receiving configuration-direct, configuration-direct before socket module creation socket address structure
It is used to indicate and binds VPN mark for specified interface, configuration-direct carries the VPN mark to bind with specified interface;
The VPN for checking that configuration-direct carries is identified whether and other interfaces in Redis client in addition to specified interface
The VPN mark of binding is identical;
If not, the VPN mark that configuration-direct is carried is bound with specified interface;
If so, the IP address of the opposite equip. according to the connection of other interfaces and the specified Redis of specified interface connection
The IP address of server-side judges whether that the VPN for carrying configuration-direct mark is bound with specified interface.
As one embodiment, the IP address and specified interface of the opposite equip. that VPN module is connected according to other interfaces
The IP address of the specified Redis server-side of connection judges whether that the VPN for carrying configuration-direct mark is bound with specified interface,
Include:
The IP for the specified Redis server-side that the IP address of the opposite equip. of more other interface connections is connected with specified interface
Address;
If identical, forbid binding and returning to Bind Failed the VPN mark that configuration-direct carries with specified interface disappearing
Breath;
If it is different, then the VPN mark that configuration-direct is carried is bound with specified interface.
As one embodiment, socket module creation includes at least the socket address structure of VPN index, comprising:
Obtain the VPN index for being reported in Redis client;
Socket address structure is created, and the VPN index obtained is added to the designated position of socket address structure.
As one embodiment, TCP connection module is according to the VPN index in socket address structure in Redis client
It is established between specified Redis server-side and belongs to the TCP connection that VPN identifies corresponding VPN, comprising:
By having bound the specified interface of the VPN mark, carry out with the specified Redis server-side for TCP
The interaction of connection, to establish TCP between the specified interface of the Redis client and the specified Redis server-side
Connection, the TCP connection belong to the VPN and identify corresponding VPN.
So far, the structure description of Fig. 5 shown device is completed.
Accordingly, the application also provides the hardware structure diagram of Fig. 5 shown device.As shown in fig. 6, the hardware configuration can wrap
It includes: machine readable storage medium and processor, in which:
Machine readable storage medium: store instruction code.
Processor: communicating with machine readable storage medium, reads and executees the instruction code in machine readable storage medium,
Realize TCP connection method for building up disclosed in the present embodiment.
So far, the hardware structure diagram of Fig. 6 shown device is completed.
The foregoing is merely the preferred embodiments of the application, not to limit the application, all essences in the application
Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the application protection.
Claims (10)
1. a kind of connection method for building up, which is characterized in that this method is applied to Redis client, comprising:
Creation includes at least the socket address structure of VPN index, the socket address structure and the socket pair created
It answers, TCP connection to be established is associated between the socket and the Redis client and specified Redis server-side, described
VPN index is the index of the VPN mark of specified interface binding in the Redis client, and the specified interface is the Redis
The interface of the specified Redis server-side is connected in client;
According to the VPN index in the socket address structure the Redis client and the specified Redis server-side it
Between establish belong to the TCP connection that the VPN identifies corresponding VPN.
2. described the method according to claim 1, wherein before the creation socket address structure
Method further include:
Configuration-direct is received, the configuration-direct, which is used to indicate, binds VPN mark for the specified interface, and the configuration-direct is taken
VPN mark of the band to be bound with specified interface;
Check VPN that the configuration-direct carries identify whether in the Redis client in addition to the specified interface
The VPN mark of other interface bindings is identical;
If not, the VPN mark that the configuration-direct is carried is bound with the specified interface;
If so, the IP address of opposite equip. and specifying for specified interface connection according to other interface connections
The IP address of Redis server-side judges whether that the VPN for carrying configuration-direct mark is bound with the specified interface.
3. according to the method described in claim 2, it is characterized in that, the IP of the opposite equip. according to the connection of other interfaces
The IP address of the specified Redis server-side of location and specified interface connection, judges whether to carry the configuration-direct
VPN mark is bound with the specified interface, comprising:
Compare the specified Redis server-side that the IP address of the opposite equip. of other interface connections is connected with the specified interface
IP address;
If identical, forbid binding and returning to binding the VPN mark that the configuration-direct carries with the specified interface losing
Lose message;
If it is different, then the VPN mark that the configuration-direct is carried is bound with the specified interface.
4. the method according to claim 1, wherein the creation includes at least the socket address of VPN index
Structure, comprising:
Obtain the VPN index for being reported in the Redis client;
Socket address structure is created, and the VPN index obtained is added to the specified of the socket address structure
Position.
5. the method according to claim 1, wherein the VPN index according in socket address structure exists
It is established between the Redis client and the specified Redis server-side and belongs to the TCP connection that VPN identifies corresponding VPN,
Include:
By having bound the specified interface of the VPN mark, carry out with the specified Redis server-side for TCP connection
Interaction, to establish TCP connection between the specified interface of the Redis client and the specified Redis server-side,
The TCP connection belongs to the VPN and identifies corresponding VPN.
6. device is established in a kind of connection, which is characterized in that the device is applied to Redis client, comprising:
Word modules are socketed, for create the socket address structure for including at least VPN index, the socket address structure and
The socket of creation is corresponding, TCP to be established between the socket and the Redis client and specified Redis server-side
Association is connected, the VPN index is the index of the VPN mark of specified interface binding in the Redis client, and described specify connects
Mouth is the interface that the specified Redis server-side is connected in the Redis client;
TCP connection module, for according to the VPN index in the socket address structure the Redis client with it is described
It is established between specified Redis server-side and belongs to the TCP connection that the VPN identifies corresponding VPN.
7. device according to claim 6, which is characterized in that the device further comprises:
VPN module, it is described for before the socket address structure described in the socket module creation, receiving configuration-direct
Configuration-direct is used to indicate binds VPN mark for the specified interface, and the configuration-direct is carried to bind with specified interface
VPN mark;
Check VPN that the configuration-direct carries identify whether in the Redis client in addition to the specified interface
The VPN mark of other interface bindings is identical;
If not, the VPN mark that the configuration-direct is carried is bound with the specified interface;
If so, the IP address of opposite equip. and specifying for specified interface connection according to other interface connections
The IP address of Redis server-side judges whether that the VPN for carrying configuration-direct mark is bound with the specified interface.
8. device according to claim 7, which is characterized in that the opposite end that the VPN module is connected according to other interfaces is set
The IP address of standby IP address and the specified Redis server-side of specified interface connection judges whether to refer to the configuration
The VPN mark carried is enabled to bind with the specified interface, comprising:
Compare the specified Redis server-side that the IP address of the opposite equip. of other interface connections is connected with the specified interface
IP address;
If identical, forbid binding and returning to binding the VPN mark that the configuration-direct carries with the specified interface losing
Lose message;
If it is different, then the VPN mark that the configuration-direct is carried is bound with the specified interface.
9. device according to claim 6, which is characterized in that the socket module creation includes at least VPN index
Socket address structure, comprising:
Obtain the VPN index for being reported in the Redis client;
Socket address structure is created, and the VPN index obtained is added to the specified of the socket address structure
Position.
10. device according to claim 6, which is characterized in that the TCP connection module is according to the socket address knot
VPN index in structure is established between the Redis client and the specified Redis server-side belongs to the VPN mark
The TCP connection of corresponding VPN, comprising:
By having bound the specified interface of the VPN mark, carry out with the specified Redis server-side for TCP connection
Interaction, to establish TCP connection between the specified interface of the Redis client and the specified Redis server-side,
The TCP connection belongs to the VPN and identifies corresponding VPN.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910226248.2A CN109981640B (en) | 2019-03-25 | 2019-03-25 | Connection establishment method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910226248.2A CN109981640B (en) | 2019-03-25 | 2019-03-25 | Connection establishment method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109981640A true CN109981640A (en) | 2019-07-05 |
CN109981640B CN109981640B (en) | 2021-07-23 |
Family
ID=67080270
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910226248.2A Active CN109981640B (en) | 2019-03-25 | 2019-03-25 | Connection establishment method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109981640B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101543004A (en) * | 2006-11-20 | 2009-09-23 | 英国电讯有限公司 | Secure network architecture |
CN101599901A (en) * | 2009-07-15 | 2009-12-09 | 杭州华三通信技术有限公司 | The method of remotely accessing MPLS VPN, system and gateway |
US20150288679A1 (en) * | 2014-04-02 | 2015-10-08 | Cisco Technology, Inc. | Interposer with Security Assistant Key Escrow |
CN106686056A (en) * | 2016-11-25 | 2017-05-17 | 济南中维世纪科技有限公司 | Android client communication device and method allowing Android client communication device to connect and communicate with server |
CN106888145A (en) * | 2017-03-17 | 2017-06-23 | 新华三技术有限公司 | A kind of VPN resource access methods and device |
CN108881487A (en) * | 2018-08-01 | 2018-11-23 | 安克创新科技股份有限公司 | The control method and its server and electronic equipment of terminal device base station |
CN108880885A (en) * | 2018-06-19 | 2018-11-23 | 杭州迪普科技股份有限公司 | A kind of message processing method and device |
CN109005150A (en) * | 2018-06-11 | 2018-12-14 | 烽火通信科技股份有限公司 | Based on ethernet mac address without linking communications method and system |
-
2019
- 2019-03-25 CN CN201910226248.2A patent/CN109981640B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101543004A (en) * | 2006-11-20 | 2009-09-23 | 英国电讯有限公司 | Secure network architecture |
CN101599901A (en) * | 2009-07-15 | 2009-12-09 | 杭州华三通信技术有限公司 | The method of remotely accessing MPLS VPN, system and gateway |
US20150288679A1 (en) * | 2014-04-02 | 2015-10-08 | Cisco Technology, Inc. | Interposer with Security Assistant Key Escrow |
CN106686056A (en) * | 2016-11-25 | 2017-05-17 | 济南中维世纪科技有限公司 | Android client communication device and method allowing Android client communication device to connect and communicate with server |
CN106888145A (en) * | 2017-03-17 | 2017-06-23 | 新华三技术有限公司 | A kind of VPN resource access methods and device |
CN109005150A (en) * | 2018-06-11 | 2018-12-14 | 烽火通信科技股份有限公司 | Based on ethernet mac address without linking communications method and system |
CN108880885A (en) * | 2018-06-19 | 2018-11-23 | 杭州迪普科技股份有限公司 | A kind of message processing method and device |
CN108881487A (en) * | 2018-08-01 | 2018-11-23 | 安克创新科技股份有限公司 | The control method and its server and electronic equipment of terminal device base station |
Also Published As
Publication number | Publication date |
---|---|
CN109981640B (en) | 2021-07-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109992465A (en) | Service tracks method, apparatus and computer readable storage medium | |
CN103475682B (en) | File transfer method and file transfer equipment | |
CN110581903A (en) | multilayer intranet penetration method, system and medium | |
CN106506620A (en) | Cloud desktop intelligent terminal management system | |
CN104040995B (en) | Multimedia redirection method, multimedia server, and computer system | |
CN103246606B (en) | The performance test methods of ESB platform and system | |
CN103873449B (en) | Method for network access and system | |
CN109379742A (en) | Access method, device and storage medium of wireless local area network | |
CN107402782A (en) | A kind of method and device for being used to load plug-in unit in live software | |
CN101582916A (en) | Network application system based on P2P and application method thereof | |
CN105245407A (en) | Network sniffer based on socket and method thereof | |
CN109976922A (en) | Discovery method, equipment and computer storage medium between small routine platform | |
CN107734046A (en) | Method, service end, client and the system of remote operation database | |
CN105991679B (en) | A kind of implementation method and device of network sharing | |
CN114039875A (en) | Data acquisition method, device and system based on eBPF technology | |
CN105518693B (en) | A kind of safety protecting method and device | |
CN106100986A (en) | Line control of communication method and device | |
CN104539752B (en) | Access method and system between multilevel field platform | |
CN111104336A (en) | Online service interface testing method and device based on container and VNC | |
CN108183978A (en) | A kind of communication equipment IP address configuration method and communication equipment | |
CN111935260B (en) | Account synchronization method and device, electronic equipment and storage medium | |
CN106658224A (en) | Method for transferring audio and video data streams based on TCP mode of DSS time sharing system | |
CN106685600B (en) | Message delivery method in local area network between work station | |
CN109981640A (en) | Connect method for building up and device | |
CN111708595A (en) | Remote interactive cooperation method and device based on visual interface |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |