Source code: com/act365/net/tcp/TCPOptions.java
1 /*
2 * JSocket Wrench
3 *
4 * Copyright (C) act365.com October 2003
5 *
6 * Web site: http://www.act365.com/wrench
7 * E-mail: developers@act365.com
8 *
9 * The JSocket Wrench library adds support for low-level Internet protocols
10 * to the Java programming language.
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the Free
14 * Software Foundation; either version 2 of the License, or (at your option)
15 * any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
20 * Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License along with
23 * this program; if not, write to the Free Software Foundation, Inc.,
24 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 */
26
27 package com.act365.net.tcp ;
28
29 /**
30 * Implements various options that are permitted to appear in a TCP message.
31 */
32
33 public class TCPOptions {
34
35 boolean maxSegmentSizeSet ,
36 windowScaleFactorSet ,
37 timestampSet ;
38
39 short maxSegmentSize ;
40
41 byte windowScaleFactor ;
42
43 int timestampValue ,
44 timestampEchoReply ;
45
46 public boolean isMaxSegmentSizeSet(){
47 return maxSegmentSizeSet ;
48 }
49
50 public short getMaxSegmentSize() {
51 return maxSegmentSize ;
52 }
53
54 public void setMaxSegmentSize( short maxSegmentSize ) {
55 this.maxSegmentSize = maxSegmentSize ;
56 maxSegmentSizeSet = true ;
57 }
58
59 public boolean isWindowScaleFactorSet(){
60 return windowScaleFactorSet;
61 }
62
63 public byte getWindowScaleFactor() {
64 return windowScaleFactor ;
65 }
66
67 public void setWindowScaleFactor( byte windowScaleFactor ){
68 this.windowScaleFactor = windowScaleFactor ;
69 windowScaleFactorSet = true ;
70 }
71
72 public boolean isTimestampSet(){
73 return timestampSet ;
74 }
75
76 public int getTimestampValue() {
77 return timestampValue ;
78 }
79
80 public int getTimestampEchoReply() {
81 return timestampEchoReply ;
82 }
83
84 public void setTimestamp( int timestampValue , int timestampEchoReply ){
85 this.timestampValue = timestampValue ;
86 this.timestampEchoReply = timestampEchoReply ;
87 timestampSet = true ;
88 }
89 }
90
91