Code example for LocalSocketAddress

0
 
	public boolean InitLoop(int recvBufferSize, int sendBufferSize)
	{		 
        receiver = new LocalSocket();
		try { 
			receiver.connect(new LocalSocketAddress(localAddress));
			receiver.setReceiveBufferSize(recvBufferSize);
			//receiver.setSendBufferSize(512); 
			sender = lss.accept();
			//sender.setReceiveBufferSize(512); 
			sender.setSendBufferSize(sendBufferSize);
		} catch (IOException e) {
			e.printStackTrace();
			return false; 
		}		 
		isConnected_ = true;
        return true; 
	} 
 
    public boolean isConnected() { 
        return isConnected_;