Package core :: Module tcp_support
[hide private]
[frames] | no frames]

Source Code for Module core.tcp_support

 1  # Copyright 2011-2012 the original author or authors. 
 2  # 
 3  # Licensed under the Apache License, Version 2.0 (the "License"); 
 4  # you may not use this file except in compliance with the License. 
 5  # You may obtain a copy of the License at 
 6  # 
 7  #      http://www.apache.org/licenses/LICENSE-2.0 
 8  # 
 9  # Unless required by applicable law or agreed to in writing, software 
10  # distributed under the License is distributed on an "AS IS" BASIS, 
11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
12  # See the License for the specific language governing permissions and 
13  # limitations under the License. 
14   
15  __author__ = "Scott Horn" 
16  __email__ = "scott@hornmicro.com" 
17  __credits__ = "Based entirely on work by Tim Fox http://tfox.org" 
18   
19 -class TCPSupport(object):
20 """ Mixin module that provides all the common TCP params that can be set. """ 21
22 - def set_send_buffer_size(self, bytes):
23 """Set the TCP send buffer size. 24 25 Keyword arguments: 26 @param bytes: The size in bytes. 27 28 return a reference to self so invocations can be chained 29 """ 30 self.java_obj.setSendBufferSize(bytes) 31 return self
32 33 send_buffer_size = property(fset=set_send_buffer_size) 34
35 - def set_receive_buffer_size(self, bytes):
36 """Set the TCP receive buffer size. 37 38 Keyword arguments: 39 @param bytes: The size in bytes. 40 41 return a reference to self so invocations can be chained 42 """ 43 self.java_obj.setReceiveBufferSize(bytes) 44 return self
45 46 receive_buffer_size = property(fset=set_receive_buffer_size) 47
48 - def set_tcp_keep_alive(self, val):
49 """Set the TCP keep alive setting. 50 51 Keyword arguments: 52 @param val: If true, then TCP keep alive will be enabled. 53 54 return a reference to self so invocations can be chained 55 """ 56 self.java_obj.setTCPKeepAlive(val) 57 return self
58 59 tcp_keep_alive = property(fset=set_tcp_keep_alive) 60
61 - def set_reuse_address(self, val):
62 """Set the TCP reuse address setting. 63 64 Keyword arguments: 65 @param val: If true, then TCP reuse address will be enabled. 66 @return: a reference to self so invocations can be chained 67 """ 68 self.java_obj.setReuseAddress(val) 69 return self
70 71 reuse_address = property(fset=set_reuse_address) 72
73 - def set_so_linger(self, val):
74 """Set the TCP so linger setting. 75 76 Keyword arguments: 77 @param val: If true, then TCP so linger will be enabled. 78 79 return a reference to self so invocations can be chained 80 """ 81 self.java_obj.setSoLinger(val) 82 return self
83 84 so_linger = property(fset=set_so_linger) 85
86 - def set_traffic_class(self, val):
87 """Set the TCP traffic class setting. 88 89 Keyword arguments: 90 @param val: The TCP traffic class setting. 91 92 return a reference to self so invocations can be chained 93 """ 94 self.java_obj.setTrafficClass(val) 95 return self
96 97 traffic_class = property(fset=set_traffic_class)
98