@Override
	public NetworkConnection openConnection(ConnectionSpecification targetConnSpec)
	{
		TCPNetworkConnection toRet = null;
		if(targetConnSpec != null)
		{
			try
			{
				Object dstIPAddr = targetConnSpec.getPropertiesMap().get(TCPConnectionSpecification.DST_IP_ADDRESS_PROPERTY_NAME);
				Object srcPortNumber = targetConnSpec.getPropertiesMap().get(TCPConnectionSpecification.SRC_PORT_NUMBER_PROPERTY);
				Object dstPortNumber = targetConnSpec.getPropertiesMap().get(TCPConnectionSpecification.DST_PORT_NUMBER_PROPERTY);
				if(srcPortNumber == null && dstIPAddr == null && dstPortNumber == null)
				{
					Logger.logError("Not enough information to create a TCPNetworkConnection");
				}
				else
				{
					if(dstIPAddr == null && srcPortNumber != null)
					{
						toRet = new TCPNetworkConnection(new ServerSocket(Integer.parseInt((String)srcPortNumber)),null);
					}
					else if(dstIPAddr != null && dstPortNumber != null)
					{
						toRet = new TCPNetworkConnection(null, new Socket((String)dstIPAddr, Integer.parseInt((String)dstPortNumber)));
					}
				}
			}
			catch(Exception e)
			{
				Logger.logException("Problem occurred while trying to open a connection", e);
			}
		}
		return toRet;
	}