`

记录一下我的p2p的UDP打洞过程【localhost局域网版本】

    博客分类:
  • JAVA
 
阅读更多
MainServer在两个客户端都启动成功之后并且打洞成功之后的log

log4j:WARN No appenders could be found for logger (com.p2p.udp_dig_hole.server.MainServer).
log4j:WARN Please initialize the log4j system properly.
2014-07-19 21:04:12 INFO [com.p2p.udp_dig_hole.server.MainServer] 服务端准备启动!
2014-07-19 21:04:16 INFO [com.p2p.udp_dig_hole.server.MainServer] [StartP2PServiveChanege]我收到一个客户端的连接信息: [ip:127.0.0.1,port:49598 ],content: LOGIN|joy
2014-07-19 21:04:16 INFO [com.p2p.udp_dig_hole.server.MainServer] [dealLogin]客户端请求登录,客户端的信息为:[ip:127.0.0.1,port:49598,nickname:joy]
2014-07-19 21:04:16 INFO [com.p2p.udp_dig_hole.server.MainServer] [dealLogin]向客户端发送信息:LIST_ONLINE|127.0.0.1,49598,joy|
2014-07-19 21:04:21 INFO [com.p2p.udp_dig_hole.server.MainServer] [StartP2PServiveChanege]我收到一个客户端的连接信息: [ip:127.0.0.1,port:49599 ],content: LOGIN|wood
2014-07-19 21:04:21 INFO [com.p2p.udp_dig_hole.server.MainServer] [dealLogin]客户端请求登录,客户端的信息为:[ip:127.0.0.1,port:49599,nickname:wood]
2014-07-19 21:04:21 INFO [com.p2p.udp_dig_hole.server.MainServer] [dealLogin]向客户端发送信息:LIST_ONLINE|127.0.0.1,49598,joy|127.0.0.1,49599,wood|
2014-07-19 21:04:24 INFO [com.p2p.udp_dig_hole.server.MainServer] [StartP2PServiveChanege]我收到一个客户端的连接信息: [ip:127.0.0.1,port:49599 ],content: WANT_TO_CONNECT|joy
2014-07-19 21:04:24 INFO [com.p2p.udp_dig_hole.server.MainServer] [notifyPunchHole]客户端请求打洞!
2014-07-19 21:04:24 INFO [com.p2p.udp_dig_hole.server.MainServer] [notifyPunchHole]客户端的信息为![ip:127.0.0.1,port:49599,nickname:joy]
2014-07-19 21:04:24 INFO [com.p2p.udp_dig_hole.server.MainServer] 127.0.0.149599joy
2014-07-19 21:04:24 INFO [com.p2p.udp_dig_hole.server.MainServer] [notifyPunchHole]发送信息为![send:PUNCH_HOLE_TO|127.0.0.1|49599]
2014-07-19 21:04:24 INFO [com.p2p.udp_dig_hole.server.MainServer] PUNCH_HOLE_TO|127.0.0.1|49599
2014-07-19 21:04:24 INFO [com.p2p.udp_dig_hole.server.MainServer] [StartP2PServiveChanege]我收到一个客户端的连接信息: [ip:127.0.0.1,port:49599 ],content: SUCCESS_HOLE_TO|127.0.0.1|49599
2014-07-19 21:04:24 INFO [com.p2p.udp_dig_hole.server.MainServer] [notifyPunchHoleSuccess]通知打洞成功!
2014-07-19 21:04:24 INFO [com.p2p.udp_dig_hole.server.MainServer] [notifyPunchHoleSuccess]客户端的信息为![ip:127.0.0.1,port:49599]
2014-07-19 21:04:24 INFO [com.p2p.udp_dig_hole.server.MainServer] [notifyPunchHoleSuccess]发送信息为![send:CAN_P2P_TO|127.0.0.1|49599]




客户端joy登录了

Client------------
127.0.0.1|1000|joy
[MainClient]接收到的数据为:[ip:127.0.0.1,port:1000]内容是:LIST_ONLINE|127.0.0.1,49598,joy|
[dealListOnline]要和谁连接(192.168.0.2|1000|xwz),请输入(xxx不连接):



客户端wood登录了,并且请求登录并请求打一个洞到joy那边

Client------------
127.0.0.1|1000|wood
[MainClient]接收到的数据为:[ip:127.0.0.1,port:1000]内容是:LIST_ONLINE|127.0.0.1,49598,joy|127.0.0.1,49599,wood|
[dealListOnline]要和谁连接(192.168.0.2|1000|xwz),请输入(xxx不连接):joy
[dealListOnline]要和谁连接:WANT_TO_CONNECT|joy
[MainClient]接收到的数据为:[ip:127.0.0.1,port:1000]内容是:PUNCH_HOLE_TO|127.0.0.1|49599
[dealPunchTo]发送的报文是:HELLO_MYP2P_FRIEND|打洞
[dealPunchTo]告诉服务器打洞成功:SUCCESS_HOLE_TO|127.0.0.1|49599
[MainClient]接收到的数据为:[ip:127.0.0.1,port:49599]内容是:HELLO_MYP2P_FRIEND|打洞
[MainClient]接收到的数据为:[ip:127.0.0.1,port:49599]内容是:HELLO_MYP2P_FRIEND|打洞
[MainClient]接收到的数据为:[ip:127.0.0.1,port:49599]内容是:HELLO_MYP2P_FRIEND|打洞
[MainClient]接收到的数据为:[ip:127.0.0.1,port:1000]内容是:CAN_P2P_TO|127.0.0.1|49599
[MainClient]接收到的数据为:[ip:127.0.0.1,port:49599]内容是:HELLO_MYP2P_FRIEND|你好






分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics