1 10 11 package org.mule.providers.udp; 12 13 import org.mule.providers.AbstractServiceEnabledConnector; 14 15 18 public class UdpConnector extends AbstractServiceEnabledConnector 19 { 20 public static final int DEFAULT_SOCKET_TIMEOUT = 5000; 21 public static final int DEFAULT_BUFFER_SIZE = 64 * 1024; 22 23 private int timeout = DEFAULT_SOCKET_TIMEOUT; 24 private int bufferSize = DEFAULT_BUFFER_SIZE; 25 26 public String getProtocol() 27 { 28 return "UDP"; 29 } 30 31 public int getTimeout() 32 { 33 return timeout; 34 } 35 36 public void setTimeout(int timeout) 37 { 38 if (timeout < 1) 39 { 40 timeout = DEFAULT_SOCKET_TIMEOUT; 41 } 42 this.timeout = timeout; 43 } 44 45 public int getBufferSize() 46 { 47 return bufferSize; 48 } 49 50 public void setBufferSize(int bufferSize) 51 { 52 if (bufferSize < 1) 53 { 54 bufferSize = DEFAULT_BUFFER_SIZE; 55 } 56 this.bufferSize = bufferSize; 57 } 58 59 } 60 | Popular Tags |