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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>NeL: NLNET::CBufServer class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"> <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>NLNET::CBufServer Class Reference</h1><code>#include <<a class="el" href="a05513.html">buf_server.h</a>></code>
<p>
<p>Inheritance diagram for NLNET::CBufServer:
<p><center><img src="a02302.png" usemap="#NLNET::CBufServer_map" border="0" alt=""></center>
<map name="NLNET::CBufServer_map">
<area href="a02296.html" alt="NLNET::CBufNetBase" shape="rect" coords="0,0,155,24">
<area href="a02307.html" alt="NLNET::CCallbackServer" shape="rect" coords="0,112,155,136">
</map>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Server class for layer 1<p>
Listening socket and accepted connetions, with packet scheme. The provided buffers are sent raw (no endianness conversion). By default, the size time trigger is disabled, the time trigger is set to 20 ms.<p>
Where do the methods take place: <a class="el" href="a02302.html#NLNET_1_1CBufServera20">send()</a>, -> send buffer -> <a class="el" href="a02302.html#NLNET_1_1CCallbackServera40">update()</a>, <a class="el" href="a02302.html#NLNET_1_1CBufServera8">flush()</a> <a class="el" href="a02302.html#NLNET_1_1CCallbackServera3">bytesSent()</a>, <a class="el" href="a02302.html#NLNET_1_1CCallbackServera29">newBytesSent()</a><p>
<a class="el" href="a02302.html#NLNET_1_1CCallbackServera30">receive()</a>, <a class="el" href="a02302.html#NLNET_1_1CBufServera3">dataAvailable()</a>, <- receive buffer <- receive thread, <a class="el" href="a02302.html#NLNET_1_1CBufServera3">dataAvailable()</a>, <a class="el" href="a02302.html#NLNET_1_1CCallbackServera2">bytesReceived()</a>, <a class="el" href="a02302.html#NLNET_1_1CCallbackServera28">newBytesReceived()</a>, connection callback, disconnection callback <p>
<dl compact><dt><b>Author:</b></dt><dd>Olivier Cado <p>
Nevrax France </dd></dl>
<dl compact><dt><b>Date:</b></dt><dd>2001 </dd></dl>
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00156">156</a> of file <a class="el" href="a05513.html">buf_server.h</a>.<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>enum </td><td class="memItemRight" valign=bottom><a class="el" href="a02296.html#NLNET_1_1CCallbackServerw7">TEventType</a> { <a class="el" href="a02296.html#NLNET_1_1CCallbackServerw7NLNET_1_1CCallbackServerw10">User</a> = 'U',
<a class="el" href="a02296.html#NLNET_1_1CCallbackServerw7NLNET_1_1CCallbackServerw0">Connection</a> = 'C',
<a class="el" href="a02296.html#NLNET_1_1CCallbackServerw7NLNET_1_1CCallbackServerw1">Disconnection</a> = 'D'
}</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Type of incoming events (max 256). <a href="#NLNET_1_1CCallbackServerw7">More...</a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>enum </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServerw9">TThreadStategy</a> { <a class="el" href="a02302.html#NLNET_1_1CCallbackServerw9NLNET_1_1CCallbackServerw6">SpreadSockets</a>,
<a class="el" href="a02302.html#NLNET_1_1CCallbackServerw9NLNET_1_1CCallbackServerw2">FillThreads</a>
}</td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a13">uint64</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServera2">bytesReceived</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of bytes popped by <a class="el" href="a02302.html#NLNET_1_1CCallbackServera30">receive()</a> since the beginning. <a href="#NLNET_1_1CCallbackServera2"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a13">uint64</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServera3">bytesSent</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of bytes pushed by <a class="el" href="a02302.html#NLNET_1_1CBufServera20">send()</a> since the beginning. <a href="#NLNET_1_1CCallbackServera3"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServera2">CBufServer</a> (<a class="el" href="a02302.html#NLNET_1_1CCallbackServerw9">TThreadStategy</a> strategy=FillThreads, <a class="el" href="a04558.html#a9">uint16</a> max_threads=64, <a class="el" href="a04558.html#a9">uint16</a> max_sockets_per_thread=16, bool nodelay=true, bool replaymode=false)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServera3">dataAvailable</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServera6">disconnect</a> (<a class="el" href="a02303.html">TSockId</a> hostid, bool quick=false)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02296.html#NLNET_1_1CBufServera5">displayReceiveQueueStat</a> (<a class="el" href="a02813.html">NLMISC::CLog</a> *log=<a class="el" href="a05378.html#a12">NLMISC::InfoLog</a>)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServera6">displaySendQueueStat</a> (<a class="el" href="a02813.html">NLMISC::CLog</a> *log=<a class="el" href="a05378.html#a12">NLMISC::InfoLog</a>, <a class="el" href="a02303.html">TSockId</a> destid=<a class="el" href="a05379.html#a75">InvalidSockId</a>)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServera7">displayThreadStat</a> (<a class="el" href="a02813.html">NLMISC::CLog</a> *log=<a class="el" href="a05378.html#a12">NLMISC::InfoLog</a>)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServera8">flush</a> (<a class="el" href="a02303.html">TSockId</a> destid)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a11">uint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02296.html#NLNET_1_1CBufServera9">getReceiveQueueSize</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the size of the receive queue (mutexed). <a href="#NLNET_1_1CBufServera9"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a11">uint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServera16">getSendQueueSize</a> (<a class="el" href="a02303.html">TSockId</a> destid)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a02665.html">CInetAddress</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServera11">hostAddress</a> (<a class="el" href="a02303.html">TSockId</a> hostid)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the address of the specified host. <a href="#NLNET_1_1CBufServera11"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServera22">init</a> (<a class="el" href="a04558.html#a9">uint16</a> port)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Listens on the specified port. <a href="#NLNET_1_1CCallbackServera22"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a02665.html">CInetAddress</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServera24">listenAddress</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the internet address of the listening socket. <a href="#NLNET_1_1CCallbackServera24"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a11">uint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02296.html#NLNET_1_1CCallbackServera25">maxExpectedBlockSize</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the max size of the received messages (default: 2^31-1). <a href="#NLNET_1_1CCallbackServera25"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a11">uint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02296.html#NLNET_1_1CCallbackServera26">maxSentBlockSize</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the max size of the sent messages (default: 2^31-1). <a href="#NLNET_1_1CCallbackServera26"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a11">uint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServera27">nbConnections</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of connections (at the last <a class="el" href="a02302.html#NLNET_1_1CCallbackServera40">update()</a>). <a href="#NLNET_1_1CCallbackServera27"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a13">uint64</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServera28">newBytesReceived</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of bytes popped by <a class="el" href="a02302.html#NLNET_1_1CCallbackServera30">receive()</a> since the previous call to this method. <a href="#NLNET_1_1CCallbackServera28"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a13">uint64</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServera29">newBytesSent</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of bytes pushed by <a class="el" href="a02302.html#NLNET_1_1CBufServera20">send()</a> since the previous call to this method. <a href="#NLNET_1_1CCallbackServera29"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServera30">receive</a> (<a class="el" href="a02271.html">NLMISC::CMemStream</a> &<a class="el" href="a04223.html#a589">buffer</a>, <a class="el" href="a02303.html">TSockId</a> *hostid)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServera20">send</a> (const <a class="el" href="a02271.html">NLMISC::CMemStream</a> &<a class="el" href="a04223.html#a589">buffer</a>, <a class="el" href="a02303.html">TSockId</a> hostid)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServera21">setConnectionCallback</a> (<a class="el" href="a05379.html#a76">TNetCallback</a> cb, void *arg)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets callback for incoming connections (or NULL to disable callback). <a href="#NLNET_1_1CBufServera21"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02296.html#NLNET_1_1CBufServera22">setDisconnectionCallback</a> (<a class="el" href="a05379.html#a76">TNetCallback</a> cb, void *arg)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets callback for detecting a disconnection (or NULL to disable callback). <a href="#NLNET_1_1CBufServera22"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02296.html#NLNET_1_1CCallbackServera35">setMaxExpectedBlockSize</a> (<a class="el" href="a04558.html#a10">sint32</a> limit)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02296.html#NLNET_1_1CCallbackServera36">setMaxSentBlockSize</a> (<a class="el" href="a04558.html#a10">sint32</a> limit)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServera38">setSizeFlushTrigger</a> (<a class="el" href="a02303.html">TSockId</a> destid, <a class="el" href="a04558.html#a10">sint32</a> <a class="el" href="a04223.html#a587">size</a>)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServera39">setTimeFlushTrigger</a> (<a class="el" href="a02303.html">TSockId</a> destid, <a class="el" href="a04558.html#a10">sint32</a> ms)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServera40">update</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Update the network (call this method evenly). <a href="#NLNET_1_1CCallbackServera40"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServera28">~CBufServer</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#NLNET_1_1CBufServera28"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServerb0">addNewThread</a> (<a class="el" href="a05379.html#a81">CThreadPool</a> &threadpool, <a class="el" href="a03365.html">CServerBufSock</a> *bufsock)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void * </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServerb1">argOfConnectionCallback</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the argument of the connection callback. <a href="#NLNET_1_1CCallbackServerb1"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void * </td><td class="memItemRight" valign=bottom><a class="el" href="a02296.html#NLNET_1_1CCallbackServerb2">argOfDisconnectionCallback</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the argument of the disconnection callback. <a href="#NLNET_1_1CCallbackServerb2"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a05379.html#a76">TNetCallback</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServerb5">connectionCallback</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the connection callback. <a href="#NLNET_1_1CCallbackServerb5"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>volatile bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02296.html#NLNET_1_1CCallbackServerb6">dataAvailableFlag</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return _DataAvailable. <a href="#NLNET_1_1CCallbackServerb6"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a05379.html#a76">TNetCallback</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02296.html#NLNET_1_1CCallbackServerb7">disconnectionCallback</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the disconnection callback. <a href="#NLNET_1_1CCallbackServerb7"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServerb8">dispatchNewSocket</a> (<a class="el" href="a03365.html">CServerBufSock</a> *bufsock)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServerb9">noDelay</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the TCP_NODELAY flag. <a href="#NLNET_1_1CCallbackServerb9"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServerb11">pushBufferToHost</a> (const <a class="el" href="a02271.html">NLMISC::CMemStream</a> &<a class="el" href="a04223.html#a589">buffer</a>, <a class="el" href="a02303.html">TSockId</a> hostid)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Pushes a buffer to the specified host's send queue and update (unless not connected). <a href="#NLNET_1_1CCallbackServerb11"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02296.html#NLNET_1_1CCallbackServerb12">pushMessageIntoReceiveQueue</a> (const <a class="el" href="a04558.html#a7">uint8</a> *<a class="el" href="a04223.html#a589">buffer</a>, <a class="el" href="a04558.html#a11">uint32</a> <a class="el" href="a04223.html#a587">size</a>)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02296.html#NLNET_1_1CCallbackServerb13">pushMessageIntoReceiveQueue</a> (const std::vector< <a class="el" href="a04558.html#a7">uint8</a> > &<a class="el" href="a04223.html#a589">buffer</a>)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Push message into receive queue (mutexed). <a href="#NLNET_1_1CCallbackServerb13"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a05379.html#a78">CSynchronizedFIFO</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02296.html#NLNET_1_1CCallbackServerb14">receiveQueue</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Access to the receive queue. <a href="#NLNET_1_1CCallbackServerb14"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03366.html">CServerReceiveTask</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServerb15">receiveTask</a> (std::vector< <a class="el" href="a03880.html">NLMISC::IThread</a> * >::iterator ipt)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the receive task corresponding to a particular thread. <a href="#NLNET_1_1CCallbackServerb15"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02296.html#NLNET_1_1CCallbackServerb16">setDataAvailableFlag</a> (bool da)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets _DataAvailable. <a href="#NLNET_1_1CCallbackServerb16"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a13">uint64</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServerr0">_BytesPoppedIn</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Number of bytes popped by <a class="el" href="a02302.html#NLNET_1_1CCallbackServera30">receive()</a> since the beginning. <a href="#NLNET_1_1CBufServerr0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a13">uint64</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServerr1">_BytesPushedOut</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Number of bytes pushed by <a class="el" href="a02302.html#NLNET_1_1CBufServera20">send()</a> since the beginning. <a href="#NLNET_1_1CBufServerr1"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a05379.html#a76">TNetCallback</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServerr2">_ConnectionCallback</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Connection callback. <a href="#NLNET_1_1CBufServerr2"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void * </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServerr3">_ConnectionCbArg</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Argument of the connection callback. <a href="#NLNET_1_1CBufServerr3"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02770.html">CListenTask</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServerr4">_ListenTask</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Listen task. <a href="#NLNET_1_1CBufServerr4"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03880.html">NLMISC::IThread</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServerr5">_ListenThread</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Listen thread. <a href="#NLNET_1_1CBufServerr5"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a9">uint16</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServerr6">_MaxSocketsPerThread</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Max number of sockets handled by one thread. <a href="#NLNET_1_1CBufServerr6"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a9">uint16</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServerr7">_MaxThreads</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Max number of threads. <a href="#NLNET_1_1CBufServerr7"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a11">uint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServerr8">_NbConnections</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Number of connections (debug stat). <a href="#NLNET_1_1CBufServerr8"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServerr9">_NoDelay</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">TCP_NODELAY. <a href="#NLNET_1_1CBufServerr9"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a13">uint64</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServerr10">_PrevBytesPoppedIn</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Previous number of bytes received. <a href="#NLNET_1_1CBufServerr10"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a13">uint64</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServerr11">_PrevBytesPushedOut</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Previous number of bytes sent. <a href="#NLNET_1_1CBufServerr11"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServerr12">_ReplayMode</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Replay mode flag. <a href="#NLNET_1_1CBufServerr12"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>NLMISC::CSynchronized< <a class="el" href="a05379.html#a81">CThreadPool</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServerr13">_ThreadPool</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02302.html#NLNET_1_1CCallbackServerw9">TThreadStategy</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CBufServerr14">_ThreadStrategy</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Thread socket-handling strategy. <a href="#NLNET_1_1CBufServerr14"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Friends</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>class </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServern1">CListenTask</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>class </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServern2">CServerBufSock</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>class </td><td class="memItemRight" valign=bottom><a class="el" href="a02302.html#NLNET_1_1CCallbackServern3">CServerReceiveTask</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>class </td><td class="memItemRight" valign=bottom><a class="el" href="a02296.html#NLNET_1_1CCallbackServern4">NLNET::CBufSock</a></td></tr>
</table>
<hr><h2>Member Enumeration Documentation</h2>
<a class="anchor" name="NLNET_1_1CCallbackServerw7" doxytag="NLNET::CBufServer::TEventType" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> enum <a class="el" href="a02296.html#NLNET_1_1CCallbackServerw7">NLNET::CBufNetBase::TEventType</a><code> [inherited]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Type of incoming events (max 256).
<p>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em><a class="anchor" name="NLNET_1_1CCallbackServerw7NLNET_1_1CCallbackServerw10" doxytag="User" ></a>User</em> </td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="NLNET_1_1CCallbackServerw7NLNET_1_1CCallbackServerw0" doxytag="Connection" ></a>Connection</em> </td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="NLNET_1_1CCallbackServerw7NLNET_1_1CCallbackServerw1" doxytag="Disconnection" ></a>Disconnection</em> </td><td>
</td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="a05511.html#l00079">79</a> of file <a class="el" href="a05511.html">buf_net_base.h</a>.
<p>
<div class="fragment"><pre>00079 { <a class="code" href="a02296.html#NLNET_1_1CCallbackServerw7NLNET_1_1CCallbackServerw10">User</a> = <span class="charliteral">'U'</span>, <a class="code" href="a02296.html#NLNET_1_1CCallbackServerw7NLNET_1_1CCallbackServerw0">Connection</a> = <span class="charliteral">'C'</span>, <a class="code" href="a02296.html#NLNET_1_1CCallbackServerw7NLNET_1_1CCallbackServerw1">Disconnection</a> = <span class="charliteral">'D'</span> };
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServerw9" doxytag="NLNET::CBufServer::TThreadStategy" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> enum <a class="el" href="a02302.html#NLNET_1_1CCallbackServerw9">NLNET::CBufServer::TThreadStategy</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em><a class="anchor" name="NLNET_1_1CCallbackServerw9NLNET_1_1CCallbackServerw6" doxytag="SpreadSockets" ></a>SpreadSockets</em> </td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="NLNET_1_1CCallbackServerw9NLNET_1_1CCallbackServerw2" doxytag="FillThreads" ></a>FillThreads</em> </td><td>
</td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="a05513.html#l00160">160</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
<div class="fragment"><pre>00160 { <a class="code" href="a02302.html#NLNET_1_1CCallbackServerw9NLNET_1_1CCallbackServerw6">SpreadSockets</a>, <a class="code" href="a02302.html#NLNET_1_1CCallbackServerw9NLNET_1_1CCallbackServerw2">FillThreads</a> };
</pre></div> </td>
</tr>
</table>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="NLNET_1_1CBufServera2" doxytag="NLNET::CBufServer::CBufServer" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> NLNET::CBufServer::CBufServer </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02302.html#NLNET_1_1CCallbackServerw9">TThreadStategy</a> </td>
<td class="mdname" nowrap> <em>strategy</em> = FillThreads, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a9">uint16</a> </td>
<td class="mdname" nowrap> <em>max_threads</em> = 64, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a9">uint16</a> </td>
<td class="mdname" nowrap> <em>max_sockets_per_thread</em> = 16, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>nodelay</em> = true, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>replaymode</em> = false</td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Constructor Set nodelay to true to disable the Nagle buffering algorithm (see <a class="el" href="a02445.html">CTcpSock</a> documentation)
<p>
Definition at line <a class="el" href="a05512.html#l00058">58</a> of file <a class="el" href="a05512.html">buf_server.cpp</a>.
<p>
References <a class="el" href="a05513.html#l00335">_ListenTask</a>, <a class="el" href="a05513.html#l00338">_ListenThread</a>, <a class="el" href="a05513.html#l00370">_ReplayMode</a>, <a class="el" href="a05513.html#l00272">CListenTask</a>, <a class="el" href="a05515.html#l00040">nlnettrace</a>, and <a class="el" href="a05981.html#l00098">uint16</a>.
<p>
<div class="fragment"><pre>00059 :
00060 <a class="code" href="a02296.html#NLNET_1_1CBufNetBaseb1">CBufNetBase</a>(),
00061 <a class="code" href="a02302.html#NLNET_1_1CBufServerr9">_NoDelay</a>( nodelay ),
00062 <a class="code" href="a02302.html#NLNET_1_1CBufServerr14">_ThreadStrategy</a>( strategy ),
00063 <a class="code" href="a02302.html#NLNET_1_1CBufServerr7">_MaxThreads</a>( max_threads ),
00064 <a class="code" href="a02302.html#NLNET_1_1CBufServerr6">_MaxSocketsPerThread</a>( max_sockets_per_thread ),
00065 <a class="code" href="a02302.html#NLNET_1_1CBufServerr4">_ListenTask</a>( NULL ),
00066 <a class="code" href="a02302.html#NLNET_1_1CBufServerr5">_ListenThread</a>( NULL ),
00067 <a class="code" href="a02302.html#NLNET_1_1CBufServerr13">_ThreadPool</a>(<span class="stringliteral">"CBufServer::_ThreadPool"</span>),
00068 <a class="code" href="a02302.html#NLNET_1_1CBufServerr2">_ConnectionCallback</a>( NULL ),
00069 <a class="code" href="a02302.html#NLNET_1_1CBufServerr3">_ConnectionCbArg</a>( NULL ),
00070 <a class="code" href="a02302.html#NLNET_1_1CBufServerr1">_BytesPushedOut</a>( 0 ),
00071 <a class="code" href="a02302.html#NLNET_1_1CBufServerr0">_BytesPoppedIn</a>( 0 ),
00072 <a class="code" href="a02302.html#NLNET_1_1CBufServerr10">_PrevBytesPoppedIn</a>( 0 ),
00073 <a class="code" href="a02302.html#NLNET_1_1CBufServerr11">_PrevBytesPushedOut</a>( 0 ),
00074 <a class="code" href="a02302.html#NLNET_1_1CBufServerr8">_NbConnections</a> (0),
00075 <a class="code" href="a02302.html#NLNET_1_1CBufServerr12">_ReplayMode</a>( replaymode )
00076 {
00077 <a class="code" href="a04092.html#a0">nlnettrace</a>( <span class="stringliteral">"CBufServer::CBufServer"</span> );
00078 <span class="keywordflow">if</span> ( ! <a class="code" href="a02302.html#NLNET_1_1CBufServerr12">_ReplayMode</a> )
00079 {
00080 <a class="code" href="a02302.html#NLNET_1_1CBufServerr4">_ListenTask</a> = <span class="keyword">new</span> <a class="code" href="a02302.html#NLNET_1_1CCallbackServern1">CListenTask</a>( <span class="keyword">this</span> );
00081 <a class="code" href="a02302.html#NLNET_1_1CBufServerr5">_ListenThread</a> = IThread::create( _ListenTask );
00082 }
00083 <span class="comment">/*{</span>
00084 <span class="comment"> CSynchronized<uint32>::CAccessor syncbpi ( &_BytesPushedIn );</span>
00085 <span class="comment"> syncbpi.value() = 0;</span>
00086 <span class="comment"> }*/</span>
00087 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServera28" doxytag="NLNET::CBufServer::~CBufServer" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> NLNET::CBufServer::~<a class="el" href="a02302.html">CBufServer</a> </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Destructor.
<p>
<p>
Definition at line <a class="el" href="a05512.html#l00166">166</a> of file <a class="el" href="a05512.html">buf_server.cpp</a>.
<p>
References <a class="el" href="a05513.html#l00487">NLNET::CServerReceiveTask::_Connections</a>, <a class="el" href="a05513.html#l00335">_ListenTask</a>, <a class="el" href="a05513.html#l00338">_ListenThread</a>, <a class="el" href="a05513.html#l00370">_ReplayMode</a>, <a class="el" href="a05513.html#l00346">_ThreadPool</a>, <a class="el" href="a03880.html#NLMISC_1_1IThreada1">NLMISC::IThread::getRunnable()</a>, <a class="el" href="a05622.html#l00101">nldebug</a>, <a class="el" href="a05515.html#l00040">nlnettrace</a>, <a class="el" href="a05513.html#l00284">receiveTask()</a>, <a class="el" href="a05513.html#l00056">NLNET::CServerTask::requireExit()</a>, and <a class="el" href="a03880.html#NLMISC_1_1IThreada6">NLMISC::IThread::wait()</a>.
<p>
<div class="fragment"><pre>00167 {
00168 <a class="code" href="a04092.html#a0">nlnettrace</a>( <span class="stringliteral">"CBufServer::~CBufServer"</span> );
00169
00170 <span class="comment">// Clean listen thread exit</span>
00171 <span class="keywordflow">if</span> ( ! <a class="code" href="a02302.html#NLNET_1_1CBufServerr12">_ReplayMode</a> )
00172 {
00173 ((<a class="code" href="a02302.html#NLNET_1_1CCallbackServern1">CListenTask</a>*)(<a class="code" href="a02302.html#NLNET_1_1CBufServerr5">_ListenThread</a>-><a class="code" href="a03880.html#NLMISC_1_1IThreada1">getRunnable</a>()))->requireExit();
00174 ((<a class="code" href="a02302.html#NLNET_1_1CCallbackServern1">CListenTask</a>*)(<a class="code" href="a02302.html#NLNET_1_1CBufServerr5">_ListenThread</a>-><a class="code" href="a03880.html#NLMISC_1_1IThreada1">getRunnable</a>()))->close();
00175 <span class="preprocessor">#ifdef NL_OS_UNIX</span>
00176 <span class="preprocessor"></span> <a class="code" href="a02302.html#NLNET_1_1CBufServerr4">_ListenTask</a>->wakeUp();
00177 <span class="preprocessor">#endif</span>
00178 <span class="preprocessor"></span> <a class="code" href="a02302.html#NLNET_1_1CBufServerr5">_ListenThread</a>-><a class="code" href="a03880.html#NLMISC_1_1IThreada6">wait</a>();
00179 <span class="keyword">delete</span> <a class="code" href="a02302.html#NLNET_1_1CBufServerr5">_ListenThread</a>;
00180 <span class="keyword">delete</span> <a class="code" href="a02302.html#NLNET_1_1CBufServerr4">_ListenTask</a>;
00181
00182 <span class="comment">// Clean receive thread exits</span>
00183 CThreadPool::iterator ipt;
00184 {
00185 <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL1: Waiting for end of threads..."</span> );
00186 CSynchronized<CThreadPool>::CAccessor poolsync( &_ThreadPool );
00187 <span class="keywordflow">for</span> ( ipt=poolsync.value().begin(); ipt!=poolsync.value().end(); ++ipt )
00188 {
00189 <span class="comment">// Tell the threads to exit and wake them up</span>
00190 <a class="code" href="a02302.html#NLNET_1_1CCallbackServern3">CServerReceiveTask</a> *task = <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb15">receiveTask</a>(ipt);
00191 <a class="code" href="a04092.html#a0">nlnettrace</a>( <span class="stringliteral">"Requiring exit"</span> );
00192 task->requireExit();
00193
00194 <span class="comment">// Wake the threads up</span>
00195 <span class="preprocessor"> #ifdef NL_OS_UNIX</span>
00196 <span class="preprocessor"></span> task->wakeUp();
00197 <span class="preprocessor"> #else</span>
00198 <span class="preprocessor"></span> CConnections::iterator ipb;
00199 <a class="code" href="a04092.html#a0">nlnettrace</a>( <span class="stringliteral">"Closing sockets (Win32)"</span> );
00200 {
00201 CSynchronized<CConnections>::CAccessor connectionssync( &task->_Connections );
00202 <span class="keywordflow">for</span> ( ipb=connectionssync.value().begin(); ipb!=connectionssync.value().end(); ++ipb )
00203 {
00204 (*ipb)->Sock->close();
00205 }
00206 }
00207 <span class="preprocessor"> #endif</span>
00208 <span class="preprocessor"></span>
00209 }
00210
00211 <a class="code" href="a04092.html#a0">nlnettrace</a>( <span class="stringliteral">"Waiting"</span> );
00212 <span class="keywordflow">for</span> ( ipt=poolsync.value().begin(); ipt!=poolsync.value().end(); ++ipt )
00213 {
00214 <span class="comment">// Wait until the threads have exited</span>
00215 (*ipt)->wait();
00216 }
00217
00218 <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL1: Deleting sockets, tasks and threads..."</span> );
00219 <span class="keywordflow">for</span> ( ipt=poolsync.value().begin(); ipt!=poolsync.value().end(); ++ipt )
00220 {
00221 <span class="comment">// Delete the socket objects</span>
00222 <a class="code" href="a02302.html#NLNET_1_1CCallbackServern3">CServerReceiveTask</a> *task = <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb15">receiveTask</a>(ipt);
00223 CConnections::iterator ipb;
00224 {
00225 CSynchronized<CConnections>::CAccessor connectionssync( &task->_Connections );
00226 <span class="keywordflow">for</span> ( ipb=connectionssync.value().begin(); ipb!=connectionssync.value().end(); ++ipb )
00227 {
00228 <span class="keyword">delete</span> (*ipb); <span class="comment">// closes and deletes the socket</span>
00229 }
00230 }
00231
00232 <span class="comment">// Delete the task objects</span>
00233 <span class="keyword">delete</span> task;
00234
00235 <span class="comment">// Delete the thread objects</span>
00236 <span class="keyword">delete</span> (*ipt);
00237 }
00238 }
00239 }
00240
00241 <a class="code" href="a04092.html#a0">nlnettrace</a>( <span class="stringliteral">"Exiting CBufServer::~CBufServer"</span> );
00242 }
</pre></div> </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NLNET_1_1CCallbackServerb0" doxytag="NLNET::CBufServer::addNewThread" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufServer::addNewThread </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a05379.html#a81">CThreadPool</a> & </td>
<td class="mdname" nowrap> <em>threadpool</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a03365.html">CServerBufSock</a> * </td>
<td class="mdname" nowrap> <em>bufsock</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [protected]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05512.html#l00958">958</a> of file <a class="el" href="a05512.html">buf_server.cpp</a>.
<p>
References <a class="el" href="a05513.html#l00432">NLNET::CServerReceiveTask::addNewSocket()</a>, <a class="el" href="a05513.html#l00273">CServerReceiveTask</a>, <a class="el" href="a05513.html#l00115">NLNET::CThreadPool</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00101">nldebug</a>, <a class="el" href="a05515.html#l00040">nlnettrace</a>, and <a class="el" href="a05515.html#l00351">NLNET::CServerBufSock::setOwnerTask()</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00866">dispatchNewSocket()</a>.
<p>
<div class="fragment"><pre>00959 {
00960 <a class="code" href="a04092.html#a0">nlnettrace</a>( <span class="stringliteral">"CBufServer::addNewThread"</span> );
00961 <a class="code" href="a04199.html#a6">nlassert</a>( bufsock != NULL );
00962
00963 <span class="comment">// Create new task and dispatch the socket to it</span>
00964 <a class="code" href="a02302.html#NLNET_1_1CCallbackServern3">CServerReceiveTask</a> *task = <span class="keyword">new</span> <a class="code" href="a02302.html#NLNET_1_1CCallbackServern3">CServerReceiveTask</a>( <span class="keyword">this</span> );
00965 bufsock->setOwnerTask( task );
00966 task->addNewSocket( bufsock );
00967
00968 <span class="comment">// Add a new thread to the pool, with this task</span>
00969 IThread *thr = IThread::create( task );
00970 {
00971 threadpool.push_back( thr );
00972 thr->start();
00973 <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL1: Added a new thread; pool size is %d"</span>, threadpool.size() );
00974 <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL1: New socket dispatched to thread %d"</span>, threadpool.size()-1 );
00975 }
00976 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServerb1" doxytag="NLNET::CBufServer::argOfConnectionCallback" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void* NLNET::CBufServer::argOfConnectionCallback </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [inline, protected]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the argument of the connection callback.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00314">314</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
References <a class="el" href="a05513.html#l00352">_ConnectionCbArg</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00364">dataAvailable()</a>.
<p>
<div class="fragment"><pre>00314 { <span class="keywordflow">return</span> <a class="code" href="a02302.html#NLNET_1_1CBufServerr3">_ConnectionCbArg</a>; }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServerb2" doxytag="NLNET::CBufServer::argOfDisconnectionCallback" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void* NLNET::CBufNetBase::argOfDisconnectionCallback </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [inline, protected, inherited]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the argument of the disconnection callback.
<p>
<p>
Definition at line <a class="el" href="a05511.html#l00160">160</a> of file <a class="el" href="a05511.html">buf_net_base.h</a>.
<p>
References <a class="el" href="a05511.html#l00220">NLNET::CBufNetBase::_DisconnectionCbArg</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00364">dataAvailable()</a>, and <a class="el" href="a05506.html#l00140">NLNET::CBufClient::dataAvailable()</a>.
<p>
<div class="fragment"><pre>00160 { <span class="keywordflow">return</span> _DisconnectionCbArg; }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServera2" doxytag="NLNET::CBufServer::bytesReceived" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a13">uint64</a> NLNET::CBufServer::bytesReceived </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the number of bytes popped by <a class="el" href="a02302.html#NLNET_1_1CCallbackServera30">receive()</a> since the beginning.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00255">255</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
References <a class="el" href="a05513.html#l00358">_BytesPoppedIn</a>, and <a class="el" href="a05981.html#l00102">uint64</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00749">newBytesReceived()</a>.
<p>
<div class="fragment"><pre>00255 { <span class="keywordflow">return</span> <a class="code" href="a02302.html#NLNET_1_1CBufServerr0">_BytesPoppedIn</a>; }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServera3" doxytag="NLNET::CBufServer::bytesSent" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a13">uint64</a> NLNET::CBufServer::bytesSent </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the number of bytes pushed by <a class="el" href="a02302.html#NLNET_1_1CBufServera20">send()</a> since the beginning.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00261">261</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
References <a class="el" href="a05513.html#l00355">_BytesPushedOut</a>, and <a class="el" href="a05981.html#l00102">uint64</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00761">newBytesSent()</a>.
<p>
<div class="fragment"><pre>00261 { <span class="keywordflow">return</span> <a class="code" href="a02302.html#NLNET_1_1CBufServerr1">_BytesPushedOut</a>; }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServerb5" doxytag="NLNET::CBufServer::connectionCallback" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a05379.html#a76">TNetCallback</a> NLNET::CBufServer::connectionCallback </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [inline, protected]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the connection callback.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00311">311</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
References <a class="el" href="a05513.html#l00349">_ConnectionCallback</a>, and <a class="el" href="a05511.html#l00047">NLNET::TNetCallback</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00364">dataAvailable()</a>.
<p>
<div class="fragment"><pre>00311 { <span class="keywordflow">return</span> <a class="code" href="a02302.html#NLNET_1_1CBufServerr2">_ConnectionCallback</a>; }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServera3" doxytag="NLNET::CBufServer::dataAvailable" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool NLNET::CBufServer::dataAvailable </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Checks if there is some data to receive. Returns false if the receive queue is empty. This is where the connection/disconnection callbacks can be called.
<p>
Reimplemented in <a class="el" href="a02307.html#NLNET_1_1CCallbackServerd0">NLNET::CCallbackServer</a>.
<p>
Definition at line <a class="el" href="a05512.html#l00364">364</a> of file <a class="el" href="a05512.html">buf_server.cpp</a>.
<p>
References <a class="el" href="a05513.html#l00314">argOfConnectionCallback()</a>, <a class="el" href="a05511.html#l00160">NLNET::CBufNetBase::argOfDisconnectionCallback()</a>, <a class="el" href="a05514.html#l00329">NLNET::CBufSock::asString()</a>, <a class="el" href="a05646.html#l00649">buffer</a>, <a class="el" href="a05511.html#l00056">NLNET::CFifoAccessor</a>, <a class="el" href="a05513.html#l00311">connectionCallback()</a>, <a class="el" href="a05511.html#l00206">NLNET::CBufNetBase::dataAvailableFlag()</a>, <a class="el" href="a05511.html#l00157">NLNET::CBufNetBase::disconnectionCallback()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00101">nldebug</a>, <a class="el" href="a05622.html#l00154">nlerror</a>, <a class="el" href="a05622.html#l00111">nlinfo</a>, <a class="el" href="a05511.html#l00154">NLNET::CBufNetBase::receiveQueue()</a>, <a class="el" href="a05515.html#l00234">NLNET::CBufSock::setConnectedState()</a>, <a class="el" href="a05511.html#l00203">NLNET::CBufNetBase::setDataAvailableFlag()</a>, <a class="el" href="a05586.html#l00107">NLMISC::stringFromVector()</a>, <a class="el" href="a05511.html#l00042">NLNET::TSockId</a>, <a class="el" href="a05981.html#l00098">uint16</a>, and <a class="el" href="a05981.html#l00096">uint8</a>.
<p>
<div class="fragment"><pre>00365 {
00366 <span class="comment">// slow down the layer H_AUTO (CBufServer_dataAvailable);</span>
00367 {
00368 <span class="comment">/* If no data available, enter the 'while' loop and return false (1 volatile test)</span>
00369 <span class="comment"> * If there are user data available, enter the 'while' and return true immediately (1 volatile test + 1 short locking)</span>
00370 <span class="comment"> * If there is a connection/disconnection event (rare), call the callback and loop</span>
00371 <span class="comment"> */</span>
00372 <span class="keywordflow">while</span> ( <a class="code" href="a02296.html#NLNET_1_1CCallbackServerb6">dataAvailableFlag</a>() )
00373 {
00374 <span class="comment">// Because _DataAvailable is true, the receive queue is not empty at this point</span>
00375 vector<uint8> <a class="code" href="a04223.html#a589">buffer</a>;
00376 <a class="code" href="a04558.html#a7">uint8</a> val;
00377 {
00378 <a class="code" href="a05379.html#a79">CFifoAccessor</a> recvfifo( &<a class="code" href="a02296.html#NLNET_1_1CCallbackServerb14">receiveQueue</a>() );
00379 val = recvfifo.value().frontLast();
00380 <span class="keywordflow">if</span> ( val != CBufNetBase::User )
00381 {
00382 recvfifo.value().front( buffer );
00383 }
00384 }
00385
00386 <span class="comment">/*sint32 mbsize = recvfifo.value().size() / 1048576;</span>
00387 <span class="comment"> if ( mbsize > 0 )</span>
00388 <span class="comment"> {</span>
00389 <span class="comment"> nlwarning( "The receive queue size exceeds %d MB", mbsize );</span>
00390 <span class="comment"> }*/</span>
00391
00392 <span class="comment">/*vector<uint8> buffer;</span>
00393 <span class="comment"> recvfifo.value().front( buffer );*/</span>
00394
00395 <span class="comment">// Test if it the next block is a system event</span>
00396 <span class="comment">//switch ( buffer[buffer.size()-1] )</span>
00397 <span class="keywordflow">switch</span> ( val )
00398 {
00399
00400 <span class="comment">// Normal message available</span>
00401 <span class="keywordflow">case</span> CBufNetBase::User:
00402 <span class="keywordflow">return</span> <span class="keyword">true</span>; <span class="comment">// return immediatly, do not extract the message</span>
00403
00404 <span class="comment">// Process disconnection event</span>
00405 <span class="keywordflow">case</span> CBufNetBase::Disconnection:
00406 {
00407 <a class="code" href="a05379.html#a74">TSockId</a> sockid = *((<a class="code" href="a05379.html#a74">TSockId</a>*)(&*<a class="code" href="a04223.html#a589">buffer</a>.begin()));
00408 <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL1: Disconnection event for %p %s"</span>, sockid, sockid->asString().c_str());
00409
00410 sockid->setConnectedState( <span class="keyword">false</span> );
00411
00412 <span class="comment">// Call callback if needed</span>
00413 <span class="keywordflow">if</span> ( <a class="code" href="a02296.html#NLNET_1_1CCallbackServerb7">disconnectionCallback</a>() != NULL )
00414 {
00415 <a class="code" href="a02296.html#NLNET_1_1CCallbackServerb7">disconnectionCallback</a>()( sockid, <a class="code" href="a02296.html#NLNET_1_1CCallbackServerb2">argOfDisconnectionCallback</a>() );
00416 }
00417
00418 <span class="comment">// Add socket object into the synchronized remove list</span>
00419 <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL1: Adding the connection to the remove list"</span> );
00420 <a class="code" href="a04199.html#a6">nlassert</a>( ((CServerBufSock*)sockid)->ownerTask() != NULL );
00421 ((<a class="code" href="a02302.html#NLNET_1_1CCallbackServern2">CServerBufSock</a>*)sockid)->ownerTask()->addToRemoveSet( sockid );
00422 <span class="keywordflow">break</span>;
00423 }
00424 <span class="comment">// Process connection event</span>
00425 <span class="keywordflow">case</span> CBufNetBase::Connection:
00426 {
00427 <a class="code" href="a05379.html#a74">TSockId</a> sockid = *((<a class="code" href="a05379.html#a74">TSockId</a>*)(&*<a class="code" href="a04223.html#a589">buffer</a>.begin()));
00428 <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL1: Connection event for %p %s"</span>, sockid, sockid->asString().c_str());
00429
00430 sockid->setConnectedState( <span class="keyword">true</span> );
00431
00432 <span class="comment">// Call callback if needed</span>
00433 <span class="keywordflow">if</span> ( <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb5">connectionCallback</a>() != NULL )
00434 {
00435 <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb5">connectionCallback</a>()( sockid, <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb1">argOfConnectionCallback</a>() );
00436 }
00437 <span class="keywordflow">break</span>;
00438 }
00439 <span class="keywordflow">default</span>: <span class="comment">// should not occur</span>
00440 <a class="code" href="a04199.html#a1">nlinfo</a>( <span class="stringliteral">"LNETL1: Invalid block type: %hu (should be = to %hu"</span>, (<a class="code" href="a04558.html#a9">uint16</a>)(buffer[<a class="code" href="a04223.html#a589">buffer</a>.size()-1]), (<a class="code" href="a04558.html#a9">uint16</a>)(val) );
00441 <a class="code" href="a04199.html#a1">nlinfo</a>( <span class="stringliteral">"LNETL1: Buffer (%d B): [%s]"</span>, <a class="code" href="a04223.html#a589">buffer</a>.size(), <a class="code" href="a05378.html#a258">stringFromVector</a>(buffer).c_str() );
00442 <a class="code" href="a04199.html#a1">nlinfo</a>( <span class="stringliteral">"LNETL1: Receive queue:"</span> );
00443 {
00444 <a class="code" href="a05379.html#a79">CFifoAccessor</a> recvfifo( &<a class="code" href="a02296.html#NLNET_1_1CCallbackServerb14">receiveQueue</a>() );
00445 recvfifo.value().display();
00446 }
00447 <a class="code" href="a04199.html#a3">nlerror</a>( <span class="stringliteral">"LNETL1: Invalid system event type in server receive queue"</span> );
00448
00449 }
00450
00451 <span class="comment">// Extract system event</span>
00452 {
00453 <a class="code" href="a05379.html#a79">CFifoAccessor</a> recvfifo( &<a class="code" href="a02296.html#NLNET_1_1CCallbackServerb14">receiveQueue</a>() );
00454 recvfifo.value().pop();
00455 <a class="code" href="a02296.html#NLNET_1_1CCallbackServerb16">setDataAvailableFlag</a>( ! recvfifo.value().empty() );
00456 }
00457 }
00458 <span class="comment">// _DataAvailable is false here</span>
00459 <span class="keywordflow">return</span> <span class="keyword">false</span>;
00460 }
00461 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServerb6" doxytag="NLNET::CBufServer::dataAvailableFlag" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> volatile bool NLNET::CBufNetBase::dataAvailableFlag </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [inline, protected, inherited]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Return _DataAvailable.
<p>
<p>
Definition at line <a class="el" href="a05511.html#l00206">206</a> of file <a class="el" href="a05511.html">buf_net_base.h</a>.
<p>
References <a class="el" href="a05511.html#l00214">NLNET::CBufNetBase::_DataAvailable</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00364">dataAvailable()</a>, and <a class="el" href="a05506.html#l00140">NLNET::CBufClient::dataAvailable()</a>.
<p>
<div class="fragment"><pre>00206 { <span class="keywordflow">return</span> _DataAvailable; }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServera6" doxytag="NLNET::CBufServer::disconnect" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufServer::disconnect </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02303.html">TSockId</a> </td>
<td class="mdname" nowrap> <em>hostid</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>quick</em> = false</td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Disconnect a connection Set hostid to InvalidSockId to disconnect all connections. If hostid is not InvalidSockId and the socket is not connected, the method does nothing. If quick is true, any pending data will not be sent before disconnecting.
<p>
Definition at line <a class="el" href="a05512.html#l00251">251</a> of file <a class="el" href="a05512.html">buf_server.cpp</a>.
<p>
References <a class="el" href="a05513.html#l00487">NLNET::CServerReceiveTask::_Connections</a>, <a class="el" href="a05513.html#l00346">_ThreadPool</a>, <a class="el" href="a02444.html#NLNET_1_1CUdpSockz2109_0">NLNET::CSock::connected()</a>, <a class="el" href="a06487.html#l00101">NLNET::CTcpSock::disconnect()</a>, <a class="el" href="a05514.html#l00137">NLNET::CBufSock::flush()</a>, <a class="el" href="a05515.html#l00040">nlnettrace</a>, <a class="el" href="a05513.html#l00284">receiveTask()</a>, <a class="el" href="a05515.html#l00243">NLNET::CBufSock::Sock</a>, and <a class="el" href="a05511.html#l00042">NLNET::TSockId</a>.
<p>
<div class="fragment"><pre>00252 {
00253 <a class="code" href="a04092.html#a0">nlnettrace</a>( <span class="stringliteral">"CBufServer::disconnect"</span> );
00254 <span class="keywordflow">if</span> ( hostid != InvalidSockId )
00255 {
00256 <span class="comment">// Disconnect only if physically connected</span>
00257 <span class="keywordflow">if</span> ( hostid->Sock->connected() )
00258 {
00259 <span class="keywordflow">if</span> ( ! quick )
00260 {
00261 hostid->flush();
00262 }
00263 hostid->Sock->disconnect(); <span class="comment">// the connection will be removed by the next call of update()</span>
00264 }
00265 }
00266 <span class="keywordflow">else</span>
00267 {
00268 <span class="comment">// Disconnect all</span>
00269 CThreadPool::iterator ipt;
00270 {
00271 CSynchronized<CThreadPool>::CAccessor poolsync( &_ThreadPool );
00272 <span class="keywordflow">for</span> ( ipt=poolsync.value().begin(); ipt!=poolsync.value().end(); ++ipt )
00273 {
00274 <a class="code" href="a02302.html#NLNET_1_1CCallbackServern3">CServerReceiveTask</a> *task = <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb15">receiveTask</a>(ipt);
00275 CConnections::iterator ipb;
00276 {
00277 CSynchronized<CConnections>::CAccessor connectionssync( &task->_Connections );
00278 <span class="keywordflow">for</span> ( ipb=connectionssync.value().begin(); ipb!=connectionssync.value().end(); ++ipb )
00279 {
00280 <span class="keywordflow">if</span> ( (*ipb)->Sock->connected() )
00281 {
00282 <span class="keywordflow">if</span> ( ! quick )
00283 {
00284 (*ipb)->flush();
00285 }
00286 (*ipb)->Sock->disconnect();
00287 }
00288 }
00289 }
00290 }
00291 }
00292 }
00293 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServerb7" doxytag="NLNET::CBufServer::disconnectionCallback" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a05379.html#a76">TNetCallback</a> NLNET::CBufNetBase::disconnectionCallback </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [inline, protected, inherited]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the disconnection callback.
<p>
<p>
Definition at line <a class="el" href="a05511.html#l00157">157</a> of file <a class="el" href="a05511.html">buf_net_base.h</a>.
<p>
References <a class="el" href="a05511.html#l00217">NLNET::CBufNetBase::_DisconnectionCallback</a>, and <a class="el" href="a05511.html#l00047">NLNET::TNetCallback</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00364">dataAvailable()</a>, and <a class="el" href="a05506.html#l00140">NLNET::CBufClient::dataAvailable()</a>.
<p>
<div class="fragment"><pre>00157 { <span class="keywordflow">return</span> _DisconnectionCallback; }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServerb8" doxytag="NLNET::CBufServer::dispatchNewSocket" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufServer::dispatchNewSocket </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a03365.html">CServerBufSock</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>bufsock</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [protected]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Binds a new socket and send buffer to an existing or a new thread (that starts) Note: this method is called in the listening thread.
<p>
Definition at line <a class="el" href="a05512.html#l00866">866</a> of file <a class="el" href="a05512.html">buf_server.cpp</a>.
<p>
References <a class="el" href="a05513.html#l00332">_MaxSocketsPerThread</a>, <a class="el" href="a05513.html#l00329">_MaxThreads</a>, <a class="el" href="a05513.html#l00346">_ThreadPool</a>, <a class="el" href="a05513.html#l00326">_ThreadStrategy</a>, <a class="el" href="a05513.html#l00432">NLNET::CServerReceiveTask::addNewSocket()</a>, <a class="el" href="a05512.html#l00958">addNewThread()</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a05622.html#l00101">nldebug</a>, <a class="el" href="a05515.html#l00040">nlnettrace</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05513.html#l00421">NLNET::CServerReceiveTask::numberOfConnections()</a>, <a class="el" href="a05513.html#l00284">receiveTask()</a>, <a class="el" href="a05515.html#l00351">NLNET::CServerBufSock::setOwnerTask()</a>, <a class="el" href="a02302.html#NLNET_1_1CCallbackServerw9NLNET_1_1CCallbackServerw6">SpreadSockets</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00779">NLNET::CListenTask::run()</a>.
<p>
<div class="fragment"><pre>00867 {
00868 <a class="code" href="a04092.html#a0">nlnettrace</a>( <span class="stringliteral">"CBufServer::dispatchNewSocket"</span> );
00869
00870 CSynchronized<CThreadPool>::CAccessor poolsync( &_ThreadPool );
00871 <span class="keywordflow">if</span> ( <a class="code" href="a02302.html#NLNET_1_1CBufServerr14">_ThreadStrategy</a> == <a class="code" href="a02302.html#NLNET_1_1CCallbackServerw9NLNET_1_1CCallbackServerw6">SpreadSockets</a> )
00872 {
00873 <span class="comment">// Find the thread with the smallest number of connections and check if all</span>
00874 <span class="comment">// threads do not have the same number of connections</span>
00875 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04061.html#a0">min</a> = 0xFFFFFFFF;
00876 <a class="code" href="a04558.html#a15">uint</a> max = 0;
00877 CThreadPool::iterator ipt, iptmin, iptmax;
00878 <span class="keywordflow">for</span> ( iptmin=iptmax=ipt=poolsync.value().begin(); ipt!=poolsync.value().end(); ++ipt )
00879 {
00880 <a class="code" href="a04558.html#a15">uint</a> noc = <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb15">receiveTask</a>(ipt)->numberOfConnections();
00881 <span class="keywordflow">if</span> ( noc < <a class="code" href="a04061.html#a0">min</a> )
00882 {
00883 <a class="code" href="a04061.html#a0">min</a> = noc;
00884 iptmin = ipt;
00885 }
00886 <span class="keywordflow">if</span> ( noc > max )
00887 {
00888 max = noc;
00889 iptmax = ipt;
00890 }
00891 }
00892
00893 <span class="comment">// Check if we make the pool of threads grow (if we have not found vacant room</span>
00894 <span class="comment">// and if it is allowed to)</span>
00895 <span class="keywordflow">if</span> ( (poolsync.value().empty()) ||
00896 ((<a class="code" href="a04061.html#a0">min</a> == max) && (poolsync.value().size() < <a class="code" href="a02302.html#NLNET_1_1CBufServerr7">_MaxThreads</a>)) )
00897 {
00898 <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb0">addNewThread</a>( poolsync.value(), bufsock );
00899 }
00900 <span class="keywordflow">else</span>
00901 {
00902 <span class="comment">// Dispatch socket to an existing thread of the pool</span>
00903 <a class="code" href="a02302.html#NLNET_1_1CCallbackServern3">CServerReceiveTask</a> *task = <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb15">receiveTask</a>(iptmin);
00904 bufsock->setOwnerTask( task );
00905 task->addNewSocket( bufsock );
00906 <span class="preprocessor">#ifdef NL_OS_UNIX</span>
00907 <span class="preprocessor"></span> task->wakeUp();
00908 <span class="preprocessor">#endif </span>
00909 <span class="preprocessor"></span>
00910 <span class="keywordflow">if</span> ( <a class="code" href="a04061.html#a0">min</a> >= (<a class="code" href="a04558.html#a15">uint</a>)<a class="code" href="a02302.html#NLNET_1_1CBufServerr6">_MaxSocketsPerThread</a> )
00911 {
00912 <a class="code" href="a04199.html#a2">nlwarning</a>( <span class="stringliteral">"LNETL1: Exceeding the maximum number of sockets per thread"</span> );
00913 }
00914 <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL1: New socket dispatched to thread %d"</span>, iptmin-poolsync.value().begin() );
00915 }
00916
00917 }
00918 <span class="keywordflow">else</span> <span class="comment">// _ThreadStrategy == FillThreads</span>
00919 {
00920 CThreadPool::iterator ipt;
00921 <span class="keywordflow">for</span> ( ipt=poolsync.value().begin(); ipt!=poolsync.value().end(); ++ipt )
00922 {
00923 <a class="code" href="a04558.html#a15">uint</a> noc = <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb15">receiveTask</a>(ipt)->numberOfConnections();
00924 <span class="keywordflow">if</span> ( noc < <a class="code" href="a02302.html#NLNET_1_1CBufServerr6">_MaxSocketsPerThread</a> )
00925 {
00926 <span class="keywordflow">break</span>;
00927 }
00928 }
00929
00930 <span class="comment">// Check if we have to make the thread pool grow (if we have not found vacant room)</span>
00931 <span class="keywordflow">if</span> ( ipt == poolsync.value().end() )
00932 {
00933 <span class="keywordflow">if</span> ( poolsync.value().size() == <a class="code" href="a02302.html#NLNET_1_1CBufServerr7">_MaxThreads</a> )
00934 {
00935 <a class="code" href="a04199.html#a2">nlwarning</a>( <span class="stringliteral">"LNETL1: Exceeding the maximum number of threads"</span> );
00936 }
00937 <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb0">addNewThread</a>( poolsync.value(), bufsock );
00938 }
00939 <span class="keywordflow">else</span>
00940 {
00941 <span class="comment">// Dispatch socket to an existing thread of the pool</span>
00942 <a class="code" href="a02302.html#NLNET_1_1CCallbackServern3">CServerReceiveTask</a> *task = <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb15">receiveTask</a>(ipt);
00943 bufsock->setOwnerTask( task );
00944 task->addNewSocket( bufsock );
00945 <span class="preprocessor">#ifdef NL_OS_UNIX</span>
00946 <span class="preprocessor"></span> task->wakeUp();
00947 <span class="preprocessor">#endif </span>
00948 <span class="preprocessor"></span> <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL1: New socket dispatched to thread %d"</span>, ipt-poolsync.value().begin() );
00949 }
00950 }
00951 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServera5" doxytag="NLNET::CBufServer::displayReceiveQueueStat" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufNetBase::displayReceiveQueueStat </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02813.html">NLMISC::CLog</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>log</em> = <a class="el" href="a05378.html#a12">NLMISC::InfoLog</a> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [inline, inherited]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Reimplemented in <a class="el" href="a02305.html#NLNET_1_1CCallbackClienta10">NLNET::CCallbackClient</a>, and <a class="el" href="a02307.html#NLNET_1_1CCallbackServera9">NLNET::CCallbackServer</a>.
<p>
Definition at line <a class="el" href="a05511.html#l00094">94</a> of file <a class="el" href="a05511.html">buf_net_base.h</a>.
<p>
References <a class="el" href="a05511.html#l00211">NLNET::CBufNetBase::_RecvFifo</a>, and <a class="el" href="a05511.html#l00056">NLNET::CFifoAccessor</a>.
<p>
<div class="fragment"><pre>00095 {
00096 <a class="code" href="a05379.html#a79">CFifoAccessor</a> syncfifo( &_RecvFifo );
00097 syncfifo.value().displayStats(log);
00098 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServera6" doxytag="NLNET::CBufServer::displaySendQueueStat" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufServer::displaySendQueueStat </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02813.html">NLMISC::CLog</a> * </td>
<td class="mdname" nowrap> <em>log</em> = <a class="el" href="a05378.html#a12">NLMISC::InfoLog</a>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a02303.html">TSockId</a> </td>
<td class="mdname" nowrap> <em>destid</em> = <a class="el" href="a05379.html#a75">InvalidSockId</a></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Reimplemented in <a class="el" href="a02307.html#NLNET_1_1CCallbackServera10">NLNET::CCallbackServer</a>.
<p>
Definition at line <a class="el" href="a05512.html#l00713">713</a> of file <a class="el" href="a05512.html">buf_server.cpp</a>.
<p>
References <a class="el" href="a05513.html#l00487">NLNET::CServerReceiveTask::_Connections</a>, <a class="el" href="a05513.html#l00346">_ThreadPool</a>, <a class="el" href="a05508.html#l00528">NLMISC::CBufFIFO::displayStats()</a>, <a class="el" href="a05513.html#l00284">receiveTask()</a>, <a class="el" href="a05515.html#l00240">NLNET::CBufSock::SendFifo</a>, and <a class="el" href="a05511.html#l00042">NLNET::TSockId</a>.
<p>
<div class="fragment"><pre>00714 {
00715 <span class="keywordflow">if</span> ( destid != InvalidSockId )
00716 {
00717 destid->SendFifo.displayStats(log);
00718 }
00719 <span class="keywordflow">else</span>
00720 {
00721 <span class="comment">// add all client buffers</span>
00722
00723 <span class="comment">// For each thread</span>
00724 CThreadPool::iterator ipt;
00725 {
00726 CSynchronized<CThreadPool>::CAccessor poolsync( &_ThreadPool );
00727 <span class="keywordflow">for</span> ( ipt=poolsync.value().begin(); ipt!=poolsync.value().end(); ++ipt )
00728 {
00729 <span class="comment">// For each thread of the pool</span>
00730 <a class="code" href="a02302.html#NLNET_1_1CCallbackServern3">CServerReceiveTask</a> *task = <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb15">receiveTask</a>(ipt);
00731 CConnections::iterator ipb;
00732 {
00733 CSynchronized<CConnections>::CAccessor connectionssync( &task->_Connections );
00734 <span class="keywordflow">for</span> ( ipb=connectionssync.value().begin(); ipb!=connectionssync.value().end(); ++ipb )
00735 {
00736 <span class="comment">// For each socket of the thread, update sending</span>
00737 (*ipb)->SendFifo.displayStats(log);
00738 }
00739 }
00740 }
00741 }
00742 }
00743 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServera7" doxytag="NLNET::CBufServer::displayThreadStat" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufServer::displayThreadStat </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02813.html">NLMISC::CLog</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>log</em> = <a class="el" href="a05378.html#a12">NLMISC::InfoLog</a> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Reimplemented in <a class="el" href="a02307.html#NLNET_1_1CCallbackServera11">NLNET::CCallbackServer</a>.
<p>
Definition at line <a class="el" href="a05512.html#l00695">695</a> of file <a class="el" href="a05512.html">buf_server.cpp</a>.
<p>
References <a class="el" href="a05513.html#l00335">_ListenTask</a>, <a class="el" href="a05513.html#l00346">_ThreadPool</a>, <a class="el" href="a05943.html#l00323">NLMISC::CLog::displayNL()</a>, <a class="el" href="a05513.html#l00063">NLNET::CServerTask::NbLoop</a>, and <a class="el" href="a05513.html#l00284">receiveTask()</a>.
<p>
<div class="fragment"><pre>00696 {
00697 <span class="comment">// For each thread</span>
00698 CThreadPool::iterator ipt;
00699 {
00700 CSynchronized<CThreadPool>::CAccessor poolsync( &_ThreadPool );
00701 <span class="keywordflow">for</span> ( ipt=poolsync.value().begin(); ipt!=poolsync.value().end(); ++ipt )
00702 {
00703 <span class="comment">// For each thread of the pool</span>
00704 <a class="code" href="a02302.html#NLNET_1_1CCallbackServern3">CServerReceiveTask</a> *task = <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb15">receiveTask</a>(ipt);
00705 <span class="comment">// For each socket of the thread, update sending</span>
00706 log-><a class="code" href="a02813.html#NLNET_1_1CNetLoga7">displayNL</a> (<span class="stringliteral">"server receive thread %p nbloop %d"</span>, task, task->NbLoop);
00707 }
00708 }
00709
00710 log-><a class="code" href="a02813.html#NLNET_1_1CNetLoga7">displayNL</a> (<span class="stringliteral">"server listen thread %p nbloop %d"</span>, _ListenTask, <a class="code" href="a02302.html#NLNET_1_1CBufServerr4">_ListenTask</a>->NbLoop);
00711 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServera8" doxytag="NLNET::CBufServer::flush" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool NLNET::CBufServer::flush </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02303.html">TSockId</a> </td>
<td class="mdname1" valign="top" nowrap> <em>destid</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Force to send all data pending in the send queue. <dl compact><dt><b>Returns:</b></dt><dd>False if an error has occured (e.g. the remote host is disconnected). To retrieve the reason of the error, call <a class="el" href="a02444.html#NLNET_1_1CUdpSocke1">CSock::getLastError()</a> and/or <a class="el" href="a02444.html#NLNET_1_1CUdpSocke0">CSock::errorString()</a></dd></dl>
<p>
Reimplemented in <a class="el" href="a02307.html#NLNET_1_1CCallbackServera12">NLNET::CCallbackServer</a>.
<p>
Definition at line <a class="el" href="a05513.html#l00232">232</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
References <a class="el" href="a05514.html#l00137">NLNET::CBufSock::flush()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05511.html#l00042">NLNET::TSockId</a>.
<p>
<div class="fragment"><pre>00232 { <a class="code" href="a04199.html#a6">nlassert</a>( destid != InvalidSockId ); <span class="keywordflow">return</span> destid->flush(); }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServera9" doxytag="NLNET::CBufServer::getReceiveQueueSize" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a11">uint32</a> NLNET::CBufNetBase::getReceiveQueueSize </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [inline, inherited]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the size of the receive queue (mutexed).
<p>
<p>
Reimplemented in <a class="el" href="a02305.html#NLNET_1_1CCallbackClienta18">NLNET::CCallbackClient</a>, and <a class="el" href="a02307.html#NLNET_1_1CCallbackServera15">NLNET::CCallbackServer</a>.
<p>
Definition at line <a class="el" href="a05511.html#l00088">88</a> of file <a class="el" href="a05511.html">buf_net_base.h</a>.
<p>
References <a class="el" href="a05511.html#l00211">NLNET::CBufNetBase::_RecvFifo</a>, <a class="el" href="a05511.html#l00056">NLNET::CFifoAccessor</a>, and <a class="el" href="a05981.html#l00100">uint32</a>.
<p>
<div class="fragment"><pre>00089 {
00090 <a class="code" href="a05379.html#a79">CFifoAccessor</a> syncfifo( &_RecvFifo );
00091 <span class="keywordflow">return</span> syncfifo.value().size();
00092 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServera16" doxytag="NLNET::CBufServer::getSendQueueSize" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a11">uint32</a> NLNET::CBufServer::getSendQueueSize </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02303.html">TSockId</a> </td>
<td class="mdname1" valign="top" nowrap> <em>destid</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05512.html#l00660">660</a> of file <a class="el" href="a05512.html">buf_server.cpp</a>.
<p>
References <a class="el" href="a05513.html#l00487">NLNET::CServerReceiveTask::_Connections</a>, <a class="el" href="a05513.html#l00346">_ThreadPool</a>, <a class="el" href="a05513.html#l00284">receiveTask()</a>, <a class="el" href="a05515.html#l00240">NLNET::CBufSock::SendFifo</a>, <a class="el" href="a05508.html#l00410">NLMISC::CBufFIFO::size()</a>, <a class="el" href="a05511.html#l00042">NLNET::TSockId</a>, and <a class="el" href="a05981.html#l00100">uint32</a>.
<p>
<div class="fragment"><pre>00661 {
00662 <span class="keywordflow">if</span> ( destid != InvalidSockId )
00663 {
00664 <span class="keywordflow">return</span> destid->SendFifo.size();
00665 }
00666 <span class="keywordflow">else</span>
00667 {
00668 <span class="comment">// add all client buffers</span>
00669
00670 <a class="code" href="a04558.html#a11">uint32</a> total = 0;
00671
00672 <span class="comment">// For each thread</span>
00673 CThreadPool::iterator ipt;
00674 {
00675 CSynchronized<CThreadPool>::CAccessor poolsync( &_ThreadPool );
00676 <span class="keywordflow">for</span> ( ipt=poolsync.value().begin(); ipt!=poolsync.value().end(); ++ipt )
00677 {
00678 <span class="comment">// For each thread of the pool</span>
00679 <a class="code" href="a02302.html#NLNET_1_1CCallbackServern3">CServerReceiveTask</a> *task = <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb15">receiveTask</a>(ipt);
00680 CConnections::iterator ipb;
00681 {
00682 CSynchronized<CConnections>::CAccessor connectionssync( &task->_Connections );
00683 <span class="keywordflow">for</span> ( ipb=connectionssync.value().begin(); ipb!=connectionssync.value().end(); ++ipb )
00684 {
00685 <span class="comment">// For each socket of the thread, update sending</span>
00686 total = (*ipb)->SendFifo.size ();
00687 }
00688 }
00689 }
00690 }
00691 <span class="keywordflow">return</span> total;
00692 }
00693 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServera11" doxytag="NLNET::CBufServer::hostAddress" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> const <a class="el" href="a02665.html">CInetAddress</a>& NLNET::CBufServer::hostAddress </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02303.html">TSockId</a> </td>
<td class="mdname1" valign="top" nowrap> <em>hostid</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the address of the specified host.
<p>
<p>
Reimplemented in <a class="el" href="a02307.html#NLNET_1_1CCallbackServera20">NLNET::CCallbackServer</a>.
<p>
Definition at line <a class="el" href="a05513.html#l00241">241</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
References <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06405.html#l00238">NLNET::CSock::remoteAddr()</a>, <a class="el" href="a05515.html#l00243">NLNET::CBufSock::Sock</a>, and <a class="el" href="a05511.html#l00042">NLNET::TSockId</a>.
<p>
<div class="fragment"><pre>00241 { <a class="code" href="a04199.html#a6">nlassert</a>( hostid != InvalidSockId ); <span class="keywordflow">return</span> hostid->Sock->remoteAddr(); }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServera22" doxytag="NLNET::CBufServer::init" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufServer::init </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a04558.html#a9">uint16</a> </td>
<td class="mdname1" valign="top" nowrap> <em>port</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Listens on the specified port.
<p>
<p>
Definition at line <a class="el" href="a05512.html#l00093">93</a> of file <a class="el" href="a05512.html">buf_server.cpp</a>.
<p>
References <a class="el" href="a05513.html#l00335">_ListenTask</a>, <a class="el" href="a05513.html#l00338">_ListenThread</a>, <a class="el" href="a05513.html#l00370">_ReplayMode</a>, <a class="el" href="a05512.html#l00111">NLNET::CListenTask::init()</a>, <a class="el" href="a05511.html#l00135">NLNET::CBufNetBase::maxExpectedBlockSize()</a>, <a class="el" href="a05622.html#l00101">nldebug</a>, <a class="el" href="a05515.html#l00040">nlnettrace</a>, <a class="el" href="a03880.html#NLMISC_1_1IThreada4">NLMISC::IThread::start()</a>, and <a class="el" href="a05981.html#l00098">uint16</a>.
<p>
Referenced by <a class="el" href="a06098.html#l00207">NLNET::CNetManager::addServer()</a>, and <a class="el" href="a06645.html#l00479">NLNET::CUnifiedNetwork::init()</a>.
<p>
<div class="fragment"><pre>00094 {
00095 <a class="code" href="a04092.html#a0">nlnettrace</a>( <span class="stringliteral">"CBufServer::init"</span> );
00096 <span class="keywordflow">if</span> ( ! <a class="code" href="a02302.html#NLNET_1_1CBufServerr12">_ReplayMode</a> )
00097 {
00098 <a class="code" href="a02302.html#NLNET_1_1CBufServerr4">_ListenTask</a>->init( port, <a class="code" href="a02296.html#NLNET_1_1CCallbackServera25">maxExpectedBlockSize</a>() );
00099 <a class="code" href="a02302.html#NLNET_1_1CBufServerr5">_ListenThread</a>-><a class="code" href="a03880.html#NLMISC_1_1IThreada4">start</a>();
00100 }
00101 <span class="keywordflow">else</span>
00102 {
00103 <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL1: Binding listen socket to any address, port %hu"</span>, port );
00104 }
00105 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServera24" doxytag="NLNET::CBufServer::listenAddress" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> const <a class="el" href="a02665.html">CInetAddress</a>& NLNET::CBufServer::listenAddress </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the internet address of the listening socket.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00238">238</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
References <a class="el" href="a05513.html#l00335">_ListenTask</a>, and <a class="el" href="a05513.html#l00104">NLNET::CListenTask::localAddr()</a>.
<p>
Referenced by <a class="el" href="a05962.html#l00338">NLNET::CLoginServer::init()</a>, <a class="el" href="a05962.html#l00467">NLNET::NLMISC_DYNVARIABLE()</a>, and <a class="el" href="a05962.html#l00244">NLNET::setListenAddress()</a>.
<p>
<div class="fragment"><pre>00238 { <span class="keywordflow">return</span> <a class="code" href="a02302.html#NLNET_1_1CBufServerr4">_ListenTask</a>->localAddr(); }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServera25" doxytag="NLNET::CBufServer::maxExpectedBlockSize" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a11">uint32</a> NLNET::CBufNetBase::maxExpectedBlockSize </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [inline, inherited]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the max size of the received messages (default: 2^31-1).
<p>
<p>
Definition at line <a class="el" href="a05511.html#l00135">135</a> of file <a class="el" href="a05511.html">buf_net_base.h</a>.
<p>
References <a class="el" href="a05511.html#l00223">NLNET::CBufNetBase::_MaxExpectedBlockSize</a>, and <a class="el" href="a05981.html#l00100">uint32</a>.
<p>
Referenced by <a class="el" href="a05506.html#l00085">NLNET::CBufClient::connect()</a>, and <a class="el" href="a05512.html#l00093">init()</a>.
<p>
<div class="fragment"><pre>00136 {
00137 <span class="keywordflow">return</span> _MaxExpectedBlockSize;
00138 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServera26" doxytag="NLNET::CBufServer::maxSentBlockSize" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a11">uint32</a> NLNET::CBufNetBase::maxSentBlockSize </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [inline, inherited]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the max size of the sent messages (default: 2^31-1).
<p>
<p>
Definition at line <a class="el" href="a05511.html#l00141">141</a> of file <a class="el" href="a05511.html">buf_net_base.h</a>.
<p>
References <a class="el" href="a05511.html#l00226">NLNET::CBufNetBase::_MaxSentBlockSize</a>, and <a class="el" href="a05981.html#l00100">uint32</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00299">send()</a>, and <a class="el" href="a05506.html#l00121">NLNET::CBufClient::send()</a>.
<p>
<div class="fragment"><pre>00142 {
00143 <span class="keywordflow">return</span> _MaxSentBlockSize;
00144 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServera27" doxytag="NLNET::CBufServer::nbConnections" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a11">uint32</a> NLNET::CBufServer::nbConnections </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the number of connections (at the last <a class="el" href="a02302.html#NLNET_1_1CCallbackServera40">update()</a>).
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00267">267</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
References <a class="el" href="a05513.html#l00367">_NbConnections</a>, and <a class="el" href="a05981.html#l00100">uint32</a>.
<p>
Referenced by <a class="el" href="a05528.html#l00124">NLNET::CCallbackServer::send()</a>.
<p>
<div class="fragment"><pre>00267 { <span class="keywordflow">return</span> <a class="code" href="a02302.html#NLNET_1_1CBufServerr8">_NbConnections</a>; }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServera28" doxytag="NLNET::CBufServer::newBytesReceived" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a13">uint64</a> NLNET::CBufServer::newBytesReceived </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the number of bytes popped by <a class="el" href="a02302.html#NLNET_1_1CCallbackServera30">receive()</a> since the previous call to this method.
<p>
<p>
Definition at line <a class="el" href="a05512.html#l00749">749</a> of file <a class="el" href="a05512.html">buf_server.cpp</a>.
<p>
References <a class="el" href="a05513.html#l00361">_PrevBytesPoppedIn</a>, <a class="el" href="a05513.html#l00255">bytesReceived()</a>, and <a class="el" href="a05981.html#l00102">uint64</a>.
<p>
<div class="fragment"><pre>00750 {
00751 <a class="code" href="a04558.html#a13">uint64</a> b = <a class="code" href="a02302.html#NLNET_1_1CCallbackServera2">bytesReceived</a>();
00752 <a class="code" href="a04558.html#a13">uint64</a> nbrecvd = b - <a class="code" href="a02302.html#NLNET_1_1CBufServerr10">_PrevBytesPoppedIn</a>;
00753 <span class="comment">//nlinfo( "b: %"NL_I64"u new: %"NL_I64"u", b, nbrecvd );</span>
00754 <a class="code" href="a02302.html#NLNET_1_1CBufServerr10">_PrevBytesPoppedIn</a> = b;
00755 <span class="keywordflow">return</span> nbrecvd;
00756 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServera29" doxytag="NLNET::CBufServer::newBytesSent" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a13">uint64</a> NLNET::CBufServer::newBytesSent </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the number of bytes pushed by <a class="el" href="a02302.html#NLNET_1_1CBufServera20">send()</a> since the previous call to this method.
<p>
<p>
Definition at line <a class="el" href="a05512.html#l00761">761</a> of file <a class="el" href="a05512.html">buf_server.cpp</a>.
<p>
References <a class="el" href="a05513.html#l00364">_PrevBytesPushedOut</a>, <a class="el" href="a05513.html#l00261">bytesSent()</a>, and <a class="el" href="a05981.html#l00102">uint64</a>.
<p>
<div class="fragment"><pre>00762 {
00763 <a class="code" href="a04558.html#a13">uint64</a> b = <a class="code" href="a02302.html#NLNET_1_1CCallbackServera3">bytesSent</a>();
00764 <a class="code" href="a04558.html#a13">uint64</a> nbsent = b - <a class="code" href="a02302.html#NLNET_1_1CBufServerr11">_PrevBytesPushedOut</a>;
00765 <span class="comment">//nlinfo( "b: %"NL_I64"u new: %"NL_I64"u", b, nbsent );</span>
00766 <a class="code" href="a02302.html#NLNET_1_1CBufServerr11">_PrevBytesPushedOut</a> = b;
00767 <span class="keywordflow">return</span> nbsent;
00768 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServerb9" doxytag="NLNET::CBufServer::noDelay" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool NLNET::CBufServer::noDelay </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [inline, protected]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the TCP_NODELAY flag.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00276">276</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00779">NLNET::CListenTask::run()</a>.
<p>
<div class="fragment"><pre>00276 { <span class="keywordflow">return</span> <a class="code" href="a02302.html#NLNET_1_1CBufServerr9">_NoDelay</a>; }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServerb11" doxytag="NLNET::CBufServer::pushBufferToHost" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufServer::pushBufferToHost </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const <a class="el" href="a02271.html">NLMISC::CMemStream</a> & </td>
<td class="mdname" nowrap> <em>buffer</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a02303.html">TSockId</a> </td>
<td class="mdname" nowrap> <em>hostid</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [inline, protected]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Pushes a buffer to the specified host's send queue and update (unless not connected).
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00298">298</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
References <a class="el" href="a05513.html#l00355">_BytesPushedOut</a>, <a class="el" href="a05646.html#l00649">buffer</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05515.html#l00178">NLNET::CBufSock::pushBuffer()</a>, <a class="el" href="a05511.html#l00059">NLNET::TBlockSize</a>, and <a class="el" href="a05511.html#l00042">NLNET::TSockId</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00299">send()</a>.
<p>
<div class="fragment"><pre>00299 {
00300 <a class="code" href="a04199.html#a6">nlassert</a>( hostid != InvalidSockId );
00301 <span class="keywordflow">if</span> ( hostid->pushBuffer( buffer ) )
00302 {
00303 <a class="code" href="a02302.html#NLNET_1_1CBufServerr1">_BytesPushedOut</a> += <a class="code" href="a04223.html#a589">buffer</a>.length() + <span class="keyword">sizeof</span>(<a class="code" href="a05379.html#a80">TBlockSize</a>); <span class="comment">// statistics</span>
00304 }
00305 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServerb12" doxytag="NLNET::CBufServer::pushMessageIntoReceiveQueue" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufNetBase::pushMessageIntoReceiveQueue </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const <a class="el" href="a04558.html#a7">uint8</a> * </td>
<td class="mdname" nowrap> <em>buffer</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a11">uint32</a> </td>
<td class="mdname" nowrap> <em>size</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [inline, protected, inherited]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05511.html#l00183">183</a> of file <a class="el" href="a05511.html">buf_net_base.h</a>.
<p>
References <a class="el" href="a05511.html#l00211">NLNET::CBufNetBase::_RecvFifo</a>, <a class="el" href="a05646.html#l00649">buffer</a>, <a class="el" href="a05511.html#l00056">NLNET::CFifoAccessor</a>, <a class="el" href="a05511.html#l00203">NLNET::CBufNetBase::setDataAvailableFlag()</a>, <a class="el" href="a05646.html#l00645">size</a>, <a class="el" href="a05981.html#l00100">uint32</a>, and <a class="el" href="a05981.html#l00096">uint8</a>.
<p>
<div class="fragment"><pre>00184 {
00185 <span class="comment">//sint32 mbsize;</span>
00186 {
00187 <span class="comment">//nldebug( "BNB: Acquiring the receive queue... ");</span>
00188 <a class="code" href="a05379.html#a79">CFifoAccessor</a> recvfifo( &_RecvFifo );
00189 <span class="comment">//nldebug( "BNB: Acquired, pushing the received buffer... ");</span>
00190 recvfifo.value().push( buffer, size );
00191 <span class="comment">//nldebug( "BNB: Pushed, releasing the receive queue..." );</span>
00192 <span class="comment">//mbsize = recvfifo.value().size() / 1048576;</span>
00193 <a class="code" href="a02296.html#NLNET_1_1CCallbackServerb16">setDataAvailableFlag</a>( <span class="keyword">true</span> );
00194 }
00195 <span class="comment">//nldebug( "BNB: Released." );</span>
00196 <span class="comment">/*if ( mbsize > 1 )</span>
00197 <span class="comment"> {</span>
00198 <span class="comment"> nlwarning( "The receive queue size exceeds %d MB", mbsize );</span>
00199 <span class="comment"> }*/</span>
00200 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServerb13" doxytag="NLNET::CBufServer::pushMessageIntoReceiveQueue" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufNetBase::pushMessageIntoReceiveQueue </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const std::vector< <a class="el" href="a04558.html#a7">uint8</a> > & </td>
<td class="mdname1" valign="top" nowrap> <em>buffer</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [inline, protected, inherited]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Push message into receive queue (mutexed).
<p>
<p>
Definition at line <a class="el" href="a05511.html#l00164">164</a> of file <a class="el" href="a05511.html">buf_net_base.h</a>.
<p>
References <a class="el" href="a05511.html#l00211">NLNET::CBufNetBase::_RecvFifo</a>, <a class="el" href="a05646.html#l00649">buffer</a>, <a class="el" href="a05511.html#l00056">NLNET::CFifoAccessor</a>, and <a class="el" href="a05511.html#l00203">NLNET::CBufNetBase::setDataAvailableFlag()</a>.
<p>
Referenced by <a class="el" href="a05515.html#l00135">NLNET::CBufSock::advertiseSystemEvent()</a>, and <a class="el" href="a05506.html#l00437">NLNET::CClientReceiveTask::run()</a>.
<p>
<div class="fragment"><pre>00165 {
00166 <span class="comment">//sint32 mbsize;</span>
00167 {
00168 <span class="comment">//nldebug( "BNB: Acquiring the receive queue... ");</span>
00169 <a class="code" href="a05379.html#a79">CFifoAccessor</a> recvfifo( &_RecvFifo );
00170 <span class="comment">//nldebug( "BNB: Acquired, pushing the received buffer... ");</span>
00171 recvfifo.value().push( buffer );
00172 <span class="comment">//nldebug( "BNB: Pushed, releasing the receive queue..." );</span>
00173 <span class="comment">//mbsize = recvfifo.value().size() / 1048576;</span>
00174 <a class="code" href="a02296.html#NLNET_1_1CCallbackServerb16">setDataAvailableFlag</a>( <span class="keyword">true</span> );
00175 }
00176 <span class="comment">//nldebug( "BNB: Released." );</span>
00177 <span class="comment">//if ( mbsize > 1 )</span>
00178 <span class="comment">//{</span>
00179 <span class="comment">// nlwarning( "The receive queue size exceeds %d MB", mbsize );</span>
00180 <span class="comment">//}</span>
00181 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServera30" doxytag="NLNET::CBufServer::receive" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufServer::receive </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02271.html">NLMISC::CMemStream</a> & </td>
<td class="mdname" nowrap> <em>buffer</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a02303.html">TSockId</a> * </td>
<td class="mdname" nowrap> <em>hostid</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Receives next block of data in the specified (resizes the vector) You must call <a class="el" href="a02302.html#NLNET_1_1CBufServera3">dataAvailable()</a> before every call to <a class="el" href="a02302.html#NLNET_1_1CCallbackServera30">receive()</a>
<p>
Definition at line <a class="el" href="a05512.html#l00565">565</a> of file <a class="el" href="a05512.html">buf_server.cpp</a>.
<p>
References <a class="el" href="a05513.html#l00358">_BytesPoppedIn</a>, <a class="el" href="a05646.html#l00649">buffer</a>, <a class="el" href="a05511.html#l00056">NLNET::CFifoAccessor</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06462.html#l00060">NLMISC_BSWAP32</a>, <a class="el" href="a05515.html#l00040">nlnettrace</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05511.html#l00154">NLNET::CBufNetBase::receiveQueue()</a>, <a class="el" href="a05511.html#l00203">NLNET::CBufNetBase::setDataAvailableFlag()</a>, <a class="el" href="a05511.html#l00059">NLNET::TBlockSize</a>, <a class="el" href="a05511.html#l00042">NLNET::TSockId</a>, and <a class="el" href="a05981.html#l00100">uint32</a>.
<p>
<div class="fragment"><pre>00566 {
00567 <a class="code" href="a04092.html#a0">nlnettrace</a>( <span class="stringliteral">"CBufServer::receive"</span> );
00568 <span class="comment">//nlassert( dataAvailable() );</span>
00569 <a class="code" href="a04199.html#a6">nlassert</a>( phostid != NULL );
00570 {
00571 <a class="code" href="a05379.html#a79">CFifoAccessor</a> recvfifo( &<a class="code" href="a02296.html#NLNET_1_1CCallbackServerb14">receiveQueue</a>() );
00572 <a class="code" href="a04199.html#a6">nlassert</a>( ! recvfifo.value().empty() );
00573 recvfifo.value().front( buffer );
00574 recvfifo.value().pop();
00575 <a class="code" href="a02296.html#NLNET_1_1CCallbackServerb16">setDataAvailableFlag</a>( ! recvfifo.value().empty() );
00576 }
00577
00578 <span class="comment">// Extract hostid (and event type)</span>
00579 *phostid = *((<a class="code" href="a05379.html#a74">TSockId</a>*)&(<a class="code" href="a04223.html#a589">buffer</a>.buffer()[<a class="code" href="a04223.html#a589">buffer</a>.size()-<span class="keyword">sizeof</span>(<a class="code" href="a05379.html#a74">TSockId</a>)-1]));
00580 <a class="code" href="a04199.html#a6">nlassert</a>( <a class="code" href="a04223.html#a589">buffer</a>.buffer()[<a class="code" href="a04223.html#a589">buffer</a>.size()-1] == CBufNetBase::User );
00581
00582 <span class="comment">// debug features, we number all packet to be sure that they are all sent and received</span>
00583 <span class="comment">// \todo remove this debug feature when ok</span>
00584 <span class="preprocessor">#ifdef NL_BIG_ENDIAN</span>
00585 <span class="preprocessor"></span> <a class="code" href="a04558.html#a11">uint32</a> val = <a class="code" href="a05039.html#a1">NLMISC_BSWAP32</a>(*(<a class="code" href="a04558.html#a11">uint32</a>*)<a class="code" href="a04223.html#a589">buffer</a>.buffer());
00586 <span class="preprocessor">#else</span>
00587 <span class="preprocessor"></span> <a class="code" href="a04558.html#a11">uint32</a> val = *(<a class="code" href="a04558.html#a11">uint32</a>*)<a class="code" href="a04223.html#a589">buffer</a>.buffer();
00588 <span class="preprocessor">#endif</span>
00589 <span class="preprocessor"></span>
00590 <span class="comment">// nldebug ("receive message number %u", val);</span>
00591 <span class="keywordflow">if</span> ((*phostid)->ReceiveNextValue != val)
00592 {
00593 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"LNETL1: !!!LOST A MESSAGE!!! I received the message number %u but I'm waiting the message number %u (cnx %s), warn lecroart@nevrax.com with the log now please"</span>, val, (*phostid)->ReceiveNextValue, (*phostid)->asString().c_str());
00594 <span class="comment">// resync the message number</span>
00595 (*phostid)->ReceiveNextValue = val;
00596 }
00597
00598 (*phostid)->ReceiveNextValue++;
00599
00600 <a class="code" href="a04223.html#a589">buffer</a>.resize( <a class="code" href="a04223.html#a589">buffer</a>.size()-<span class="keyword">sizeof</span>(<a class="code" href="a05379.html#a74">TSockId</a>)-1 );
00601
00602 <span class="comment">// TODO OPTIM remove the nldebug for speed</span>
00603 <span class="comment">//commented for optimisation nldebug( "LNETL1: Read buffer (%d+%d B) from %s", buffer.size(), sizeof(TSockId)+1, /*stringFromVector(buffer).c_str(), */(*phostid)->asString().c_str() );</span>
00604
00605 <span class="comment">// Statistics</span>
00606 <a class="code" href="a02302.html#NLNET_1_1CBufServerr0">_BytesPoppedIn</a> += <a class="code" href="a04223.html#a589">buffer</a>.size() + <span class="keyword">sizeof</span>(<a class="code" href="a05379.html#a80">TBlockSize</a>);
00607 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServerb14" doxytag="NLNET::CBufServer::receiveQueue" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a05379.html#a78">CSynchronizedFIFO</a>& NLNET::CBufNetBase::receiveQueue </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [inline, protected, inherited]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Access to the receive queue.
<p>
<p>
Definition at line <a class="el" href="a05511.html#l00154">154</a> of file <a class="el" href="a05511.html">buf_net_base.h</a>.
<p>
References <a class="el" href="a05511.html#l00211">NLNET::CBufNetBase::_RecvFifo</a>, and <a class="el" href="a05511.html#l00053">NLNET::CSynchronizedFIFO</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00364">dataAvailable()</a>, <a class="el" href="a05506.html#l00140">NLNET::CBufClient::dataAvailable()</a>, <a class="el" href="a05506.html#l00318">NLNET::CBufClient::disconnect()</a>, <a class="el" href="a05512.html#l00565">receive()</a>, <a class="el" href="a05506.html#l00272">NLNET::CBufClient::receive()</a>, and <a class="el" href="a05512.html#l00987">NLNET::CServerReceiveTask::run()</a>.
<p>
<div class="fragment"><pre>00154 { <span class="keywordflow">return</span> _RecvFifo; }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServerb15" doxytag="NLNET::CBufServer::receiveTask" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a03366.html">CServerReceiveTask</a>* NLNET::CBufServer::receiveTask </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">std::vector< <a class="el" href="a03880.html">NLMISC::IThread</a> * >::iterator </td>
<td class="mdname1" valign="top" nowrap> <em>ipt</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [inline, protected]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the receive task corresponding to a particular thread.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00284">284</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00251">disconnect()</a>, <a class="el" href="a05512.html#l00866">dispatchNewSocket()</a>, <a class="el" href="a05512.html#l00713">displaySendQueueStat()</a>, <a class="el" href="a05512.html#l00695">displayThreadStat()</a>, <a class="el" href="a05512.html#l00660">getSendQueueSize()</a>, <a class="el" href="a05512.html#l00299">send()</a>, <a class="el" href="a05512.html#l00613">update()</a>, and <a class="el" href="a05512.html#l00166">~CBufServer()</a>.
<p>
<div class="fragment"><pre>00285 {
00286 <span class="keywordflow">return</span> ((<a class="code" href="a02302.html#NLNET_1_1CCallbackServern3">CServerReceiveTask</a>*)((*ipt)->getRunnable()));
00287 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServera20" doxytag="NLNET::CBufServer::send" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufServer::send </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const <a class="el" href="a02271.html">NLMISC::CMemStream</a> & </td>
<td class="mdname" nowrap> <em>buffer</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a02303.html">TSockId</a> </td>
<td class="mdname" nowrap> <em>hostid</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Send a message to the specified host, or to all hosts if hostid is InvalidSockId
<p>
Reimplemented in <a class="el" href="a02307.html#NLNET_1_1CCallbackServerd2">NLNET::CCallbackServer</a>.
<p>
Definition at line <a class="el" href="a05512.html#l00299">299</a> of file <a class="el" href="a05512.html">buf_server.cpp</a>.
<p>
References <a class="el" href="a05513.html#l00487">NLNET::CServerReceiveTask::_Connections</a>, <a class="el" href="a05513.html#l00346">_ThreadPool</a>, <a class="el" href="a05646.html#l00649">buffer</a>, <a class="el" href="a05511.html#l00141">NLNET::CBufNetBase::maxSentBlockSize()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00333">nlassertex</a>, <a class="el" href="a06462.html#l00060">NLMISC_BSWAP32</a>, <a class="el" href="a05515.html#l00040">nlnettrace</a>, <a class="el" href="a05513.html#l00298">pushBufferToHost()</a>, <a class="el" href="a05513.html#l00284">receiveTask()</a>, <a class="el" href="a05515.html#l00074">NLNET::CBufSock::SendNextValue</a>, <a class="el" href="a05511.html#l00042">NLNET::TSockId</a>, and <a class="el" href="a05981.html#l00100">uint32</a>.
<p>
<div class="fragment"><pre>00300 {
00301 <a class="code" href="a04092.html#a0">nlnettrace</a>( <span class="stringliteral">"CBufServer::send"</span> );
00302 <a class="code" href="a04199.html#a6">nlassert</a>( <a class="code" href="a04223.html#a589">buffer</a>.length() > 0 );
00303 <a class="code" href="a04199.html#a8">nlassertex</a>( <a class="code" href="a04223.html#a589">buffer</a>.length() <= <a class="code" href="a02296.html#NLNET_1_1CCallbackServera26">maxSentBlockSize</a>(), (<span class="stringliteral">"length=%u max=%u"</span>, <a class="code" href="a04223.html#a589">buffer</a>.length(), <a class="code" href="a02296.html#NLNET_1_1CCallbackServera26">maxSentBlockSize</a>()) );
00304
00305 <span class="comment">// slow down the layer H_AUTO (CBufServer_send);</span>
00306
00307 <span class="keywordflow">if</span> ( hostid != InvalidSockId )
00308 {
00309 <span class="comment">// debug features, we number all packet to be sure that they are all sent and received</span>
00310 <span class="comment">// \todo remove this debug feature when ok</span>
00311 <span class="comment">// nldebug ("send message number %u", hostid->SendNextValue);</span>
00312 <span class="preprocessor">#ifdef NL_BIG_ENDIAN</span>
00313 <span class="preprocessor"></span> <a class="code" href="a04558.html#a11">uint32</a> val = <a class="code" href="a05039.html#a1">NLMISC_BSWAP32</a>(hostid->SendNextValue);
00314 <span class="preprocessor">#else</span>
00315 <span class="preprocessor"></span> <a class="code" href="a04558.html#a11">uint32</a> val = hostid->SendNextValue;
00316 <span class="preprocessor">#endif</span>
00317 <span class="preprocessor"></span>
00318 *(<a class="code" href="a04558.html#a11">uint32</a>*)<a class="code" href="a04223.html#a589">buffer</a>.buffer() = val;
00319 hostid->SendNextValue++;
00320
00321 <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb11">pushBufferToHost</a>( buffer, hostid );
00322 }
00323 <span class="keywordflow">else</span>
00324 {
00325 <span class="comment">// Push into all send queues</span>
00326 CThreadPool::iterator ipt;
00327 {
00328 CSynchronized<CThreadPool>::CAccessor poolsync( &_ThreadPool );
00329 <span class="keywordflow">for</span> ( ipt=poolsync.value().begin(); ipt!=poolsync.value().end(); ++ipt )
00330 {
00331 <a class="code" href="a02302.html#NLNET_1_1CCallbackServern3">CServerReceiveTask</a> *task = <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb15">receiveTask</a>(ipt);
00332 CConnections::iterator ipb;
00333 {
00334 CSynchronized<CConnections>::CAccessor connectionssync( &task->_Connections );
00335 <span class="keywordflow">for</span> ( ipb=connectionssync.value().begin(); ipb!=connectionssync.value().end(); ++ipb )
00336 {
00337 <span class="comment">// Send only if the socket is logically connected</span>
00338 <span class="keywordflow">if</span> ( (*ipb)->connectedState() )
00339 {
00340 <span class="comment">// debug features, we number all packet to be sure that they are all sent and received</span>
00341 <span class="comment">// \todo remove this debug feature when ok</span>
00342 <span class="comment">// nldebug ("send message number %u", (*ipb)->SendNextValue);</span>
00343 <span class="preprocessor">#ifdef NL_BIG_ENDIAN</span>
00344 <span class="preprocessor"></span> <a class="code" href="a04558.html#a11">uint32</a> val = <a class="code" href="a05039.html#a1">NLMISC_BSWAP32</a>((*ipb)->SendNextValue);
00345 <span class="preprocessor">#else</span>
00346 <span class="preprocessor"></span> <a class="code" href="a04558.html#a11">uint32</a> val = (*ipb)->SendNextValue;
00347 <span class="preprocessor">#endif</span>
00348 <span class="preprocessor"></span> *(<a class="code" href="a04558.html#a11">uint32</a>*)<a class="code" href="a04223.html#a589">buffer</a>.buffer() = val;
00349 (*ipb)->SendNextValue++;
00350
00351 <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb11">pushBufferToHost</a>( buffer, *ipb );
00352 }
00353 }
00354 }
00355 }
00356 }
00357 }
00358 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServera21" doxytag="NLNET::CBufServer::setConnectionCallback" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufServer::setConnectionCallback </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a05379.html#a76">TNetCallback</a> </td>
<td class="mdname" nowrap> <em>cb</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>void * </td>
<td class="mdname" nowrap> <em>arg</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sets callback for incoming connections (or NULL to disable callback).
<p>
<p>
Reimplemented in <a class="el" href="a02307.html#NLNET_1_1CCallbackServera32">NLNET::CCallbackServer</a>.
<p>
Definition at line <a class="el" href="a05513.html#l00184">184</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
References <a class="el" href="a05513.html#l00349">_ConnectionCallback</a>, <a class="el" href="a05513.html#l00352">_ConnectionCbArg</a>, and <a class="el" href="a05511.html#l00047">NLNET::TNetCallback</a>.
<p>
<div class="fragment"><pre>00184 { <a class="code" href="a02302.html#NLNET_1_1CBufServerr2">_ConnectionCallback</a> = cb; <a class="code" href="a02302.html#NLNET_1_1CBufServerr3">_ConnectionCbArg</a> = arg; }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServerb16" doxytag="NLNET::CBufServer::setDataAvailableFlag" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufNetBase::setDataAvailableFlag </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">bool </td>
<td class="mdname1" valign="top" nowrap> <em>da</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [inline, protected, inherited]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sets _DataAvailable.
<p>
<p>
Definition at line <a class="el" href="a05511.html#l00203">203</a> of file <a class="el" href="a05511.html">buf_net_base.h</a>.
<p>
References <a class="el" href="a05511.html#l00214">NLNET::CBufNetBase::_DataAvailable</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00364">dataAvailable()</a>, <a class="el" href="a05506.html#l00140">NLNET::CBufClient::dataAvailable()</a>, <a class="el" href="a05506.html#l00318">NLNET::CBufClient::disconnect()</a>, <a class="el" href="a05511.html#l00164">NLNET::CBufNetBase::pushMessageIntoReceiveQueue()</a>, <a class="el" href="a05512.html#l00565">receive()</a>, <a class="el" href="a05506.html#l00272">NLNET::CBufClient::receive()</a>, and <a class="el" href="a05512.html#l00987">NLNET::CServerReceiveTask::run()</a>.
<p>
<div class="fragment"><pre>00203 { _DataAvailable = da; }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServera22" doxytag="NLNET::CBufServer::setDisconnectionCallback" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufNetBase::setDisconnectionCallback </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a05379.html#a76">TNetCallback</a> </td>
<td class="mdname" nowrap> <em>cb</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>void * </td>
<td class="mdname" nowrap> <em>arg</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [inline, inherited]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sets callback for detecting a disconnection (or NULL to disable callback).
<p>
<p>
Reimplemented in <a class="el" href="a02305.html#NLNET_1_1CCallbackClienta36">NLNET::CCallbackClient</a>, and <a class="el" href="a02307.html#NLNET_1_1CCallbackServera34">NLNET::CCallbackServer</a>.
<p>
Definition at line <a class="el" href="a05511.html#l00085">85</a> of file <a class="el" href="a05511.html">buf_net_base.h</a>.
<p>
References <a class="el" href="a05511.html#l00217">NLNET::CBufNetBase::_DisconnectionCallback</a>, <a class="el" href="a05511.html#l00220">NLNET::CBufNetBase::_DisconnectionCbArg</a>, and <a class="el" href="a05511.html#l00047">NLNET::TNetCallback</a>.
<p>
<div class="fragment"><pre>00085 { _DisconnectionCallback = cb; _DisconnectionCbArg = arg; }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServera35" doxytag="NLNET::CBufServer::setMaxExpectedBlockSize" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufNetBase::setMaxExpectedBlockSize </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a04558.html#a10">sint32</a> </td>
<td class="mdname1" valign="top" nowrap> <em>limit</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [inline, inherited]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sets the max size of the received messages. If receiving a message bigger than the limit, the connection will be dropped.<p>
Default value: 1 MegaByte If you put a negative number as limit, the max size is reset to the default value. Warning: you can call this method only at initialization time, before connecting (for a client) or calling init() (for a server) !
<p>
Definition at line <a class="el" href="a05511.html#l00109">109</a> of file <a class="el" href="a05511.html">buf_net_base.h</a>.
<p>
References <a class="el" href="a05511.html#l00223">NLNET::CBufNetBase::_MaxExpectedBlockSize</a>, <a class="el" href="a05981.html#l00099">sint32</a>, and <a class="el" href="a05981.html#l00100">uint32</a>.
<p>
<div class="fragment"><pre>00110 {
00111 <span class="keywordflow">if</span> ( limit < 0 )
00112 _MaxExpectedBlockSize = 1048576;
00113 <span class="keywordflow">else</span>
00114 _MaxExpectedBlockSize = (<a class="code" href="a04558.html#a11">uint32</a>)limit;
00115 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServera36" doxytag="NLNET::CBufServer::setMaxSentBlockSize" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufNetBase::setMaxSentBlockSize </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a04558.html#a10">sint32</a> </td>
<td class="mdname1" valign="top" nowrap> <em>limit</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [inline, inherited]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sets the max size of the sent messages. Note: Limiting of sending not implemented, currently<p>
Default value: 1 MegaByte If you put a negative number as limit, the max size is reset to the default value. Warning: you can call this method only at initialization time, before connecting (for a client) or calling init() (for a server) !
<p>
Definition at line <a class="el" href="a05511.html#l00126">126</a> of file <a class="el" href="a05511.html">buf_net_base.h</a>.
<p>
References <a class="el" href="a05511.html#l00226">NLNET::CBufNetBase::_MaxSentBlockSize</a>, <a class="el" href="a05981.html#l00099">sint32</a>, and <a class="el" href="a05981.html#l00100">uint32</a>.
<p>
<div class="fragment"><pre>00127 {
00128 <span class="keywordflow">if</span> ( limit < 0 )
00129 _MaxSentBlockSize = 1048576;
00130 <span class="keywordflow">else</span>
00131 _MaxSentBlockSize = (<a class="code" href="a04558.html#a11">uint32</a>)limit;
00132 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServera38" doxytag="NLNET::CBufServer::setSizeFlushTrigger" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufServer::setSizeFlushTrigger </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02303.html">TSockId</a> </td>
<td class="mdname" nowrap> <em>destid</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a10">sint32</a> </td>
<td class="mdname" nowrap> <em>size</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sets the size flush trigger. When the size of the send queue reaches or exceeds this value, all data in the send queue is automatically sent (-1 to disable this trigger )
<p>
Definition at line <a class="el" href="a05513.html#l00226">226</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
References <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05515.html#l00104">NLNET::CBufSock::setSizeFlushTrigger()</a>, <a class="el" href="a05981.html#l00099">sint32</a>, <a class="el" href="a05646.html#l00645">size</a>, and <a class="el" href="a05511.html#l00042">NLNET::TSockId</a>.
<p>
<div class="fragment"><pre>00226 { <a class="code" href="a04199.html#a6">nlassert</a>( destid != InvalidSockId ); destid->setSizeFlushTrigger( size ); }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServera39" doxytag="NLNET::CBufServer::setTimeFlushTrigger" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufServer::setTimeFlushTrigger </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02303.html">TSockId</a> </td>
<td class="mdname" nowrap> <em>destid</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a10">sint32</a> </td>
<td class="mdname" nowrap> <em>ms</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sets the time flush trigger (in millisecond). When this time is elapsed, all data in the send queue is automatically sent (-1 to disable this trigger)
<p>
Definition at line <a class="el" href="a05513.html#l00221">221</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
References <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05514.html#l00236">NLNET::CBufSock::setTimeFlushTrigger()</a>, <a class="el" href="a05981.html#l00099">sint32</a>, and <a class="el" href="a05511.html#l00042">NLNET::TSockId</a>.
<p>
<div class="fragment"><pre>00221 { <a class="code" href="a04199.html#a6">nlassert</a>( destid != InvalidSockId ); destid->setTimeFlushTrigger( ms ); }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServera40" doxytag="NLNET::CBufServer::update" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLNET::CBufServer::update </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Update the network (call this method evenly).
<p>
<p>
Definition at line <a class="el" href="a05512.html#l00613">613</a> of file <a class="el" href="a05512.html">buf_server.cpp</a>.
<p>
References <a class="el" href="a05513.html#l00487">NLNET::CServerReceiveTask::_Connections</a>, <a class="el" href="a05513.html#l00367">_NbConnections</a>, <a class="el" href="a05513.html#l00346">_ThreadPool</a>, <a class="el" href="a05622.html#l00101">nldebug</a>, and <a class="el" href="a05513.html#l00284">receiveTask()</a>.
<p>
<div class="fragment"><pre>00614 {
00615 <span class="comment">//nlnettrace( "CBufServer::update-BEGIN" );</span>
00616
00617 <a class="code" href="a02302.html#NLNET_1_1CBufServerr8">_NbConnections</a> = 0;
00618
00619 <span class="comment">// For each thread</span>
00620 CThreadPool::iterator ipt;
00621 {
00622 <span class="comment">//nldebug( "UPD: Acquiring the Thread Pool" );</span>
00623 CSynchronized<CThreadPool>::CAccessor poolsync( &_ThreadPool );
00624 <span class="comment">//nldebug( "UPD: Acquired." );</span>
00625 <span class="keywordflow">for</span> ( ipt=poolsync.value().begin(); ipt!=poolsync.value().end(); ++ipt )
00626 {
00627 <span class="comment">// For each thread of the pool</span>
00628 <a class="code" href="a02302.html#NLNET_1_1CCallbackServern3">CServerReceiveTask</a> *task = <a class="code" href="a02302.html#NLNET_1_1CCallbackServerb15">receiveTask</a>(ipt);
00629 CConnections::iterator ipb;
00630 {
00631 CSynchronized<CConnections>::CAccessor connectionssync( &task->_Connections );
00632 <span class="keywordflow">for</span> ( ipb=connectionssync.value().begin(); ipb!=connectionssync.value().end(); ++ipb )
00633 {
00634 <span class="comment">// For each socket of the thread, update sending</span>
00635 <span class="keywordflow">if</span> ( ! ((*ipb)->Sock->connected() && (*ipb)->update()) )
00636 {
00637 <span class="comment">// Update did not work or the socket is not connected anymore</span>
00638 <a class="code" href="a04199.html#a0">nldebug</a>( <span class="stringliteral">"LNETL1: Socket %s is disconnected"</span>, (*ipb)->asString().c_str() );
00639 <span class="comment">// Disconnection event if disconnected (known either from flush (in update) or when receiving data)</span>
00640 (*ipb)->advertiseDisconnection( <span class="keyword">this</span>, *ipb );
00641
00642 <span class="comment">/*if ( (*ipb)->advertiseDisconnection( this, *ipb ) )</span>
00643 <span class="comment"> {</span>
00644 <span class="comment"> // Now the connection removal is in dataAvailable()</span>
00645 <span class="comment"> // POLL6</span>
00646 <span class="comment"> }*/</span>
00647 }
00648 <span class="keywordflow">else</span>
00649 {
00650 <a class="code" href="a02302.html#NLNET_1_1CBufServerr8">_NbConnections</a>++;
00651 }
00652 }
00653 }
00654 }
00655 }
00656
00657 <span class="comment">//nlnettrace( "CBufServer::update-END" );</span>
00658 }
</pre></div> </td>
</tr>
</table>
<hr><h2>Friends And Related Function Documentation</h2>
<a class="anchor" name="NLNET_1_1CCallbackServern1" doxytag="NLNET::CBufServer::CListenTask" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> friend class <a class="el" href="a02770.html">CListenTask</a><code> [friend]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00272">272</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00058">CBufServer()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServern2" doxytag="NLNET::CBufServer::CServerBufSock" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> friend class <a class="el" href="a03365.html">CServerBufSock</a><code> [friend]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00271">271</a> of file <a class="el" href="a05513.html">buf_server.h</a>. </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServern3" doxytag="NLNET::CBufServer::CServerReceiveTask" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> friend class <a class="el" href="a03366.html">CServerReceiveTask</a><code> [friend]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00273">273</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00958">addNewThread()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CCallbackServern4" doxytag="NLNET::CBufServer::NLNET::CBufSock" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> friend class <a class="el" href="a02303.html">NLNET::CBufSock</a><code> [friend, inherited]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05511.html#l00148">148</a> of file <a class="el" href="a05511.html">buf_net_base.h</a>. </td>
</tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NLNET_1_1CBufServerr0" doxytag="NLNET::CBufServer::_BytesPoppedIn" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a13">uint64</a> <a class="el" href="a02302.html#NLNET_1_1CBufServerr0">NLNET::CBufServer::_BytesPoppedIn</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Number of bytes popped by <a class="el" href="a02302.html#NLNET_1_1CCallbackServera30">receive()</a> since the beginning.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00358">358</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05513.html#l00255">bytesReceived()</a>, and <a class="el" href="a05512.html#l00565">receive()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServerr1" doxytag="NLNET::CBufServer::_BytesPushedOut" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a13">uint64</a> <a class="el" href="a02302.html#NLNET_1_1CBufServerr1">NLNET::CBufServer::_BytesPushedOut</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Number of bytes pushed by <a class="el" href="a02302.html#NLNET_1_1CBufServera20">send()</a> since the beginning.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00355">355</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05513.html#l00261">bytesSent()</a>, and <a class="el" href="a05513.html#l00298">pushBufferToHost()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServerr2" doxytag="NLNET::CBufServer::_ConnectionCallback" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a05379.html#a76">TNetCallback</a> <a class="el" href="a02302.html#NLNET_1_1CBufServerr2">NLNET::CBufServer::_ConnectionCallback</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Connection callback.
<p>
<p>
Reimplemented in <a class="el" href="a02307.html#NLNET_1_1CCallbackServerr0">NLNET::CCallbackServer</a>.
<p>
Definition at line <a class="el" href="a05513.html#l00349">349</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05513.html#l00311">connectionCallback()</a>, and <a class="el" href="a05513.html#l00184">setConnectionCallback()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServerr3" doxytag="NLNET::CBufServer::_ConnectionCbArg" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void* <a class="el" href="a02302.html#NLNET_1_1CBufServerr3">NLNET::CBufServer::_ConnectionCbArg</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Argument of the connection callback.
<p>
<p>
Reimplemented in <a class="el" href="a02307.html#NLNET_1_1CCallbackServerr1">NLNET::CCallbackServer</a>.
<p>
Definition at line <a class="el" href="a05513.html#l00352">352</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05513.html#l00314">argOfConnectionCallback()</a>, and <a class="el" href="a05513.html#l00184">setConnectionCallback()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServerr4" doxytag="NLNET::CBufServer::_ListenTask" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a02770.html">CListenTask</a>* <a class="el" href="a02302.html#NLNET_1_1CBufServerr4">NLNET::CBufServer::_ListenTask</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Listen task.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00335">335</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00058">CBufServer()</a>, <a class="el" href="a05512.html#l00695">displayThreadStat()</a>, <a class="el" href="a05512.html#l00093">init()</a>, <a class="el" href="a05513.html#l00238">listenAddress()</a>, and <a class="el" href="a05512.html#l00166">~CBufServer()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServerr5" doxytag="NLNET::CBufServer::_ListenThread" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a03880.html">NLMISC::IThread</a>* <a class="el" href="a02302.html#NLNET_1_1CBufServerr5">NLNET::CBufServer::_ListenThread</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Listen thread.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00338">338</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00058">CBufServer()</a>, <a class="el" href="a05512.html#l00093">init()</a>, and <a class="el" href="a05512.html#l00166">~CBufServer()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServerr6" doxytag="NLNET::CBufServer::_MaxSocketsPerThread" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a9">uint16</a> <a class="el" href="a02302.html#NLNET_1_1CBufServerr6">NLNET::CBufServer::_MaxSocketsPerThread</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Max number of sockets handled by one thread.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00332">332</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00866">dispatchNewSocket()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServerr7" doxytag="NLNET::CBufServer::_MaxThreads" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a9">uint16</a> <a class="el" href="a02302.html#NLNET_1_1CBufServerr7">NLNET::CBufServer::_MaxThreads</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Max number of threads.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00329">329</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00866">dispatchNewSocket()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServerr8" doxytag="NLNET::CBufServer::_NbConnections" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a11">uint32</a> <a class="el" href="a02302.html#NLNET_1_1CBufServerr8">NLNET::CBufServer::_NbConnections</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Number of connections (debug stat).
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00367">367</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05513.html#l00267">nbConnections()</a>, and <a class="el" href="a05512.html#l00613">update()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServerr9" doxytag="NLNET::CBufServer::_NoDelay" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool <a class="el" href="a02302.html#NLNET_1_1CBufServerr9">NLNET::CBufServer::_NoDelay</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
TCP_NODELAY.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00323">323</a> of file <a class="el" href="a05513.html">buf_server.h</a>. </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServerr10" doxytag="NLNET::CBufServer::_PrevBytesPoppedIn" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a13">uint64</a> <a class="el" href="a02302.html#NLNET_1_1CBufServerr10">NLNET::CBufServer::_PrevBytesPoppedIn</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Previous number of bytes received.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00361">361</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00749">newBytesReceived()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServerr11" doxytag="NLNET::CBufServer::_PrevBytesPushedOut" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a13">uint64</a> <a class="el" href="a02302.html#NLNET_1_1CBufServerr11">NLNET::CBufServer::_PrevBytesPushedOut</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Previous number of bytes sent.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00364">364</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00761">newBytesSent()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServerr12" doxytag="NLNET::CBufServer::_ReplayMode" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool <a class="el" href="a02302.html#NLNET_1_1CBufServerr12">NLNET::CBufServer::_ReplayMode</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Replay mode flag.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00370">370</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00058">CBufServer()</a>, <a class="el" href="a05512.html#l00093">init()</a>, and <a class="el" href="a05512.html#l00166">~CBufServer()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServerr13" doxytag="NLNET::CBufServer::_ThreadPool" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> NLMISC::CSynchronized<<a class="el" href="a05379.html#a81">CThreadPool</a>> <a class="el" href="a02302.html#NLNET_1_1CBufServerr13">NLNET::CBufServer::_ThreadPool</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00346">346</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00251">disconnect()</a>, <a class="el" href="a05512.html#l00866">dispatchNewSocket()</a>, <a class="el" href="a05512.html#l00713">displaySendQueueStat()</a>, <a class="el" href="a05512.html#l00695">displayThreadStat()</a>, <a class="el" href="a05512.html#l00660">getSendQueueSize()</a>, <a class="el" href="a05512.html#l00299">send()</a>, <a class="el" href="a05512.html#l00613">update()</a>, and <a class="el" href="a05512.html#l00166">~CBufServer()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLNET_1_1CBufServerr14" doxytag="NLNET::CBufServer::_ThreadStrategy" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a02302.html#NLNET_1_1CCallbackServerw9">TThreadStategy</a> <a class="el" href="a02302.html#NLNET_1_1CBufServerr14">NLNET::CBufServer::_ThreadStrategy</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Thread socket-handling strategy.
<p>
<p>
Definition at line <a class="el" href="a05513.html#l00326">326</a> of file <a class="el" href="a05513.html">buf_server.h</a>.
<p>
Referenced by <a class="el" href="a05512.html#l00866">dispatchNewSocket()</a>. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="a05513.html">buf_server.h</a><li><a class="el" href="a05512.html">buf_server.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 13:53:23 2004 for NeL by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.6 </small></address>
</body>
</html>
|