2023年12月17日发(作者:)
42. try {
43. n("Open " + me + " to " + to);
44. ound = outbound;
45. ( me , this );
46. extMessage(("Hello!"));
47. } catch (IOException e) {
48. tackTrace();
49. }
50. }
51.
52. @Override
53. public void onTextMessage(CharBuffer cb) throws IOException {
54. n("Accept Message : " + cb);
55. for ( String mmib : () ) {
56. if ( !(mmib) )
57. continue;
58. try
59. {
60. CharBuffer buffer = (cb);
61. (mmib).extMessage(buffer);
62. (mmib).();
63. }
64. catch (Exception e) {
65. continue;
66. }
67. break;
68. }
69. }
70.
71. @Override
72. public void onClose(int status) {
73. if( status == 1002 || status == 1000)
74. {
75. n("Close " + me + " to " + to);
76. (this);
77. }
78. }
79.
80. @Override
81. public void onBinaryMessage(ByteBuffer bb) throws IOException {
82. }
83.
84. }
85. }
接下来编写[html]
1. <%@ page language="java" import=".*" pageEncoding="UTF-8"%>
2. <%
3. String path = textPath();
4. String basePath = eme()+"://"+verName()+":"+verPort()+path+"/";
5. %>
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23. <%
24. String message_to = ameter( "message_to" );
25. String message_me = ameter( "message_me" );
26. ribute( "message_to" , message_to );
27. ribute( "message_me" , message_me );
28. %>
29.
